diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93f2c0fea..51177e063 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/orb-java' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); diff --git a/.release-please-manifest.json b/.release-please-manifest.json index eb4e0dba7..caf148712 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.0" + ".": "1.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 666bff36b..2fd311799 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 126 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c131de17773b450eb1ec03ca001f94d3777e35347234869a7efee083003e1513.yml -openapi_spec_hash: 5d2d4a3a9ada1c381efb318b6897994d -config_hash: bcf82bddb691f6be773ac6cae8c03b9a +configured_endpoints: 139 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-3c7ee3ec9931aaeeb5e015a598812cde9edc09f114adb8759ef4c2054c90f7dc.yml +openapi_spec_hash: a14720041156fe4f353449142edacf0d +config_hash: 3279841440b02d4e8303c961d6983492 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2985ce5a0..3b96db16c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # Changelog +## 1.11.0 (2026-02-18) + +Full Changelog: [v1.10.0...v1.11.0](https://github.com/orbcorp/orb-java/compare/v1.10.0...v1.11.0) + +### Features + +* **api:** api update ([3b82472](https://github.com/orbcorp/orb-java/commit/3b8247255097a5250b47059ca568429a26e0f285)) +* **api:** api update ([c310e36](https://github.com/orbcorp/orb-java/commit/c310e36ffe22fafdd5ba9a00728e7816a8d0e1e6)) +* **api:** api update ([a80ec0b](https://github.com/orbcorp/orb-java/commit/a80ec0b34dabf9595dbae9dfc4b4ed6c914cf5d2)) +* **api:** api update ([69429b9](https://github.com/orbcorp/orb-java/commit/69429b99a2aa15ce52ebd45f7a2a531395f3dc94)) +* **api:** api update ([49d56e2](https://github.com/orbcorp/orb-java/commit/49d56e2d1ef966ebf6ad4508c81b43a19e7cf9c5)) +* **api:** api update ([1e5f897](https://github.com/orbcorp/orb-java/commit/1e5f8972d4dd8c4c955e8980b0c83901a2594bd6)) +* **api:** api update ([eaca79d](https://github.com/orbcorp/orb-java/commit/eaca79da23a8cad0430abcb0319c8a37a5bbfc2a)) +* **api:** manual updates ([5ba9c33](https://github.com/orbcorp/orb-java/commit/5ba9c33bba4f76344046e7cd93946fe96befaf34)) +* **client:** send `X-Stainless-Kotlin-Version` header ([10357a9](https://github.com/orbcorp/orb-java/commit/10357a946d98ffd0cb26409f81af477b4c4638b2)) + + +### Bug Fixes + +* **client:** preserve time zone in lenient date-time parsing ([928bfae](https://github.com/orbcorp/orb-java/commit/928bfae14d9e8353f052404bf80873f1bd60d167)) + + +### Chores + +* **ci:** upgrade `actions/github-script` ([7850067](https://github.com/orbcorp/orb-java/commit/7850067ac12719de79ff00ada02962f035782791)) +* **internal:** allow passing args to `./scripts/test` ([ffbc747](https://github.com/orbcorp/orb-java/commit/ffbc7473823b4ea0ccd27b9cfb85f8a5c165bb47)) +* **internal:** codegen related update ([489bdd6](https://github.com/orbcorp/orb-java/commit/489bdd632da69ee3bafce9d5364861821f235c2b)) +* **internal:** codegen related update ([b8b2251](https://github.com/orbcorp/orb-java/commit/b8b2251ef940a4d3a5276a9287bfc628fcc7fa2b)) +* **internal:** codegen related update ([46abca4](https://github.com/orbcorp/orb-java/commit/46abca478b99884a07ac874f56f5ab7f615d9162)) +* **internal:** correct cache invalidation for `SKIP_MOCK_TESTS` ([4a49c05](https://github.com/orbcorp/orb-java/commit/4a49c05fd112adb44adebff7481d4076ede46058)) +* **internal:** update `TestServerExtension` comment ([3447469](https://github.com/orbcorp/orb-java/commit/34474693bac76cf4855636d09bac7001108f2ccc)) +* **internal:** update maven repo doc to include authentication ([9aa3e27](https://github.com/orbcorp/orb-java/commit/9aa3e2745cf3794784ee229af579142c6d560182)) +* **internal:** upgrade AssertJ ([719f036](https://github.com/orbcorp/orb-java/commit/719f036e81d72bf5c80a3e53de1e6fcdee49f15e)) + + +### Documentation + +* add comment for arbitrary value fields ([e2f42d1](https://github.com/orbcorp/orb-java/commit/e2f42d1f5d5b951c50798e943a64e14ff134b4f2)) + ## 1.10.0 (2026-01-17) Full Changelog: [v1.9.0...v1.10.0](https://github.com/orbcorp/orb-java/compare/v1.9.0...v1.10.0) diff --git a/README.md b/README.md index be99484ce..441159b99 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/1.10.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/1.11.0) @@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho ### Gradle ```kotlin -implementation("com.withorb.api:orb-java:1.10.0") +implementation("com.withorb.api:orb-java:1.11.0") ``` ### Maven @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:1.10.0") com.withorb.api orb-java - 1.10.0 + 1.11.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 8e1585b2b..81989492b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ allprojects { group = "com.withorb.api" - version = "1.10.0" // x-release-please-version + version = "1.11.0" // x-release-please-version } subprojects { diff --git a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts index b908b3bed..78bb0bbc3 100644 --- a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts @@ -33,6 +33,9 @@ kotlin { tasks.withType().configureEach { systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent") + + // `SKIP_MOCK_TESTS` affects which tests run so it must be added as input for proper cache invalidation. + inputs.property("skipMockTests", System.getenv("SKIP_MOCK_TESTS")).optional(true) } val ktfmt by configurations.creating diff --git a/examples/.keep b/examples/.keep deleted file mode 100644 index d8c73e937..000000000 --- a/examples/.keep +++ /dev/null @@ -1,4 +0,0 @@ -File generated from our OpenAPI spec by Stainless. - -This directory can be used to store example files demonstrating usage of this SDK. -It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/orb-java-client-okhttp/build.gradle.kts b/orb-java-client-okhttp/build.gradle.kts index 856cade40..e2241172b 100644 --- a/orb-java-client-okhttp/build.gradle.kts +++ b/orb-java-client-okhttp/build.gradle.kts @@ -10,6 +10,6 @@ dependencies { implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") testImplementation(kotlin("test")) - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") } diff --git a/orb-java-core/build.gradle.kts b/orb-java-core/build.gradle.kts index 086a58f55..3ab9a87a7 100644 --- a/orb-java-core/build.gradle.kts +++ b/orb-java-core/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { testImplementation(kotlin("test")) testImplementation(project(":orb-java-client-okhttp")) testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3") testImplementation("org.junit-pioneer:junit-pioneer:1.9.1") 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 b3cc3efcc..b646ad9e4 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 @@ -14,6 +14,8 @@ import com.withorb.api.services.blocking.EventService import com.withorb.api.services.blocking.InvoiceLineItemService import com.withorb.api.services.blocking.InvoiceService import com.withorb.api.services.blocking.ItemService +import com.withorb.api.services.blocking.LicenseService +import com.withorb.api.services.blocking.LicenseTypeService import com.withorb.api.services.blocking.MetricService import com.withorb.api.services.blocking.PlanService import com.withorb.api.services.blocking.PriceService @@ -95,6 +97,10 @@ interface OrbClient { fun creditBlocks(): CreditBlockService + fun licenseTypes(): LicenseTypeService + + fun licenses(): LicenseService + /** * Closes this client, relinquishing any underlying resources. * @@ -151,5 +157,9 @@ interface OrbClient { fun subscriptionChanges(): SubscriptionChangeService.WithRawResponse fun creditBlocks(): CreditBlockService.WithRawResponse + + fun licenseTypes(): LicenseTypeService.WithRawResponse + + fun licenses(): LicenseService.WithRawResponse } } 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 a8b535120..6959d23c4 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 @@ -14,6 +14,8 @@ import com.withorb.api.services.async.EventServiceAsync import com.withorb.api.services.async.InvoiceLineItemServiceAsync import com.withorb.api.services.async.InvoiceServiceAsync import com.withorb.api.services.async.ItemServiceAsync +import com.withorb.api.services.async.LicenseServiceAsync +import com.withorb.api.services.async.LicenseTypeServiceAsync import com.withorb.api.services.async.MetricServiceAsync import com.withorb.api.services.async.PlanServiceAsync import com.withorb.api.services.async.PriceServiceAsync @@ -92,6 +94,10 @@ interface OrbClientAsync { fun creditBlocks(): CreditBlockServiceAsync + fun licenseTypes(): LicenseTypeServiceAsync + + fun licenses(): LicenseServiceAsync + /** * Closes this client, relinquishing any underlying resources. * @@ -148,5 +154,9 @@ interface OrbClientAsync { fun subscriptionChanges(): SubscriptionChangeServiceAsync.WithRawResponse fun creditBlocks(): CreditBlockServiceAsync.WithRawResponse + + fun licenseTypes(): LicenseTypeServiceAsync.WithRawResponse + + fun licenses(): LicenseServiceAsync.WithRawResponse } } 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 ba4b5c44a..66311a15b 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 @@ -26,6 +26,10 @@ import com.withorb.api.services.async.InvoiceServiceAsync import com.withorb.api.services.async.InvoiceServiceAsyncImpl import com.withorb.api.services.async.ItemServiceAsync import com.withorb.api.services.async.ItemServiceAsyncImpl +import com.withorb.api.services.async.LicenseServiceAsync +import com.withorb.api.services.async.LicenseServiceAsyncImpl +import com.withorb.api.services.async.LicenseTypeServiceAsync +import com.withorb.api.services.async.LicenseTypeServiceAsyncImpl import com.withorb.api.services.async.MetricServiceAsync import com.withorb.api.services.async.MetricServiceAsyncImpl import com.withorb.api.services.async.PlanServiceAsync @@ -119,6 +123,14 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs CreditBlockServiceAsyncImpl(clientOptionsWithUserAgent) } + private val licenseTypes: LicenseTypeServiceAsync by lazy { + LicenseTypeServiceAsyncImpl(clientOptionsWithUserAgent) + } + + private val licenses: LicenseServiceAsync by lazy { + LicenseServiceAsyncImpl(clientOptionsWithUserAgent) + } + override fun sync(): OrbClient = sync override fun withRawResponse(): OrbClientAsync.WithRawResponse = withRawResponse @@ -161,6 +173,10 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs override fun creditBlocks(): CreditBlockServiceAsync = creditBlocks + override fun licenseTypes(): LicenseTypeServiceAsync = licenseTypes + + override fun licenses(): LicenseServiceAsync = licenses + override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : @@ -235,6 +251,14 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs CreditBlockServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val licenseTypes: LicenseTypeServiceAsync.WithRawResponse by lazy { + LicenseTypeServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val licenses: LicenseServiceAsync.WithRawResponse by lazy { + LicenseServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + override fun withOptions( modifier: Consumer ): OrbClientAsync.WithRawResponse = @@ -278,5 +302,9 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs subscriptionChanges override fun creditBlocks(): CreditBlockServiceAsync.WithRawResponse = creditBlocks + + override fun licenseTypes(): LicenseTypeServiceAsync.WithRawResponse = licenseTypes + + override fun licenses(): LicenseServiceAsync.WithRawResponse = licenses } } 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 4fa187d47..5a3aca0d4 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 @@ -26,6 +26,10 @@ import com.withorb.api.services.blocking.InvoiceService import com.withorb.api.services.blocking.InvoiceServiceImpl import com.withorb.api.services.blocking.ItemService import com.withorb.api.services.blocking.ItemServiceImpl +import com.withorb.api.services.blocking.LicenseService +import com.withorb.api.services.blocking.LicenseServiceImpl +import com.withorb.api.services.blocking.LicenseTypeService +import com.withorb.api.services.blocking.LicenseTypeServiceImpl import com.withorb.api.services.blocking.MetricService import com.withorb.api.services.blocking.MetricServiceImpl import com.withorb.api.services.blocking.PlanService @@ -111,6 +115,12 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient { CreditBlockServiceImpl(clientOptionsWithUserAgent) } + private val licenseTypes: LicenseTypeService by lazy { + LicenseTypeServiceImpl(clientOptionsWithUserAgent) + } + + private val licenses: LicenseService by lazy { LicenseServiceImpl(clientOptionsWithUserAgent) } + override fun async(): OrbClientAsync = async override fun withRawResponse(): OrbClient.WithRawResponse = withRawResponse @@ -154,6 +164,10 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient { override fun creditBlocks(): CreditBlockService = creditBlocks + override fun licenseTypes(): LicenseTypeService = licenseTypes + + override fun licenses(): LicenseService = licenses + override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : @@ -227,6 +241,14 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient { CreditBlockServiceImpl.WithRawResponseImpl(clientOptions) } + private val licenseTypes: LicenseTypeService.WithRawResponse by lazy { + LicenseTypeServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val licenses: LicenseService.WithRawResponse by lazy { + LicenseServiceImpl.WithRawResponseImpl(clientOptions) + } + override fun withOptions( modifier: Consumer ): OrbClient.WithRawResponse = @@ -269,5 +291,9 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient { subscriptionChanges override fun creditBlocks(): CreditBlockService.WithRawResponse = creditBlocks + + override fun licenseTypes(): LicenseTypeService.WithRawResponse = licenseTypes + + override fun licenses(): LicenseService.WithRawResponse = licenses } } 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 cd66b87cb..1de772314 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 @@ -463,6 +463,7 @@ private constructor( headers.put("X-Stainless-Package-Version", getPackageVersion()) headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) + headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString()) apiKey.let { if (!it.isEmpty()) { headers.put("Authorization", "Bearer $it") diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt index 1373ca6ce..575d791e3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt @@ -25,7 +25,7 @@ import java.time.DateTimeException import java.time.LocalDate import java.time.LocalDateTime import java.time.OffsetDateTime -import java.time.ZonedDateTime +import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoField @@ -157,14 +157,15 @@ private class LenientOffsetDateTimeDeserializer : val temporal = formatter.parse(p.text) return when { - !temporal.isSupported(ChronoField.HOUR_OF_DAY) -> - LocalDate.from(temporal).atStartOfDay() - !temporal.isSupported(ChronoField.OFFSET_SECONDS) -> - LocalDateTime.from(temporal) - else -> ZonedDateTime.from(temporal).toLocalDateTime() - } - .atZone(context.timeZone.toZoneId()) - .toOffsetDateTime() + !temporal.isSupported(ChronoField.HOUR_OF_DAY) -> + LocalDate.from(temporal) + .atStartOfDay() + .atZone(ZoneId.of("UTC")) + .toOffsetDateTime() + !temporal.isSupported(ChronoField.OFFSET_SECONDS) -> + LocalDateTime.from(temporal).atZone(ZoneId.of("UTC")).toOffsetDateTime() + else -> OffsetDateTime.from(temporal) + } } catch (e: DateTimeException) { exceptions.add(e) } 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 f35084b4a..040e2d06a 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 @@ -41,6 +41,7 @@ private constructor( private val thresholds: JsonField>, private val type: JsonField, private val balanceAlertStatus: JsonField>, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -67,6 +68,9 @@ private constructor( @JsonProperty("balance_alert_status") @ExcludeMissing balanceAlertStatus: JsonField> = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, createdAt, @@ -79,6 +83,7 @@ private constructor( thresholds, type, balanceAlertStatus, + licenseType, mutableMapOf(), ) @@ -171,6 +176,14 @@ private constructor( fun balanceAlertStatus(): Optional> = balanceAlertStatus.getOptional("balance_alert_status") + /** + * Minified license type for alert serialization. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -259,6 +272,15 @@ private constructor( @ExcludeMissing fun _balanceAlertStatus(): JsonField> = balanceAlertStatus + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -307,6 +329,7 @@ private constructor( private var thresholds: JsonField>? = null private var type: JsonField? = null private var balanceAlertStatus: JsonField>? = null + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -322,6 +345,7 @@ private constructor( thresholds = alert.thresholds.map { it.toMutableList() } type = alert.type balanceAlertStatus = alert.balanceAlertStatus.map { it.toMutableList() } + licenseType = alert.licenseType additionalProperties = alert.additionalProperties.toMutableMap() } @@ -510,6 +534,23 @@ private constructor( } } + /** Minified license type for alert serialization. */ + fun licenseType(licenseType: LicenseType?) = licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -563,6 +604,7 @@ private constructor( checkRequired("thresholds", thresholds).map { it.toImmutable() }, checkRequired("type", type), (balanceAlertStatus ?: JsonMissing.of()).map { it.toImmutable() }, + licenseType, additionalProperties.toMutableMap(), ) } @@ -585,6 +627,7 @@ private constructor( thresholds().ifPresent { it.forEach { it.validate() } } type().validate() balanceAlertStatus().ifPresent { it.forEach { it.validate() } } + licenseType().ifPresent { it.validate() } validated = true } @@ -613,7 +656,8 @@ private constructor( (subscription.asKnown().getOrNull()?.validity() ?: 0) + (thresholds.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) + - (balanceAlertStatus.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (balanceAlertStatus.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) /** The metric the alert applies to. */ class Metric @@ -1089,6 +1133,9 @@ private constructor( @JvmField val COST_EXCEEDED = of("cost_exceeded") + @JvmField + val LICENSE_BALANCE_THRESHOLD_REACHED = of("license_balance_threshold_reached") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1099,6 +1146,7 @@ private constructor( CREDIT_BALANCE_RECOVERED, USAGE_EXCEEDED, COST_EXCEEDED, + LICENSE_BALANCE_THRESHOLD_REACHED, } /** @@ -1116,6 +1164,7 @@ private constructor( CREDIT_BALANCE_RECOVERED, USAGE_EXCEEDED, COST_EXCEEDED, + LICENSE_BALANCE_THRESHOLD_REACHED, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1134,6 +1183,7 @@ private constructor( CREDIT_BALANCE_RECOVERED -> Value.CREDIT_BALANCE_RECOVERED USAGE_EXCEEDED -> Value.USAGE_EXCEEDED COST_EXCEEDED -> Value.COST_EXCEEDED + LICENSE_BALANCE_THRESHOLD_REACHED -> Value.LICENSE_BALANCE_THRESHOLD_REACHED else -> Value._UNKNOWN } @@ -1152,6 +1202,7 @@ private constructor( CREDIT_BALANCE_RECOVERED -> Known.CREDIT_BALANCE_RECOVERED USAGE_EXCEEDED -> Known.USAGE_EXCEEDED COST_EXCEEDED -> Known.COST_EXCEEDED + LICENSE_BALANCE_THRESHOLD_REACHED -> Known.LICENSE_BALANCE_THRESHOLD_REACHED else -> throw OrbInvalidDataException("Unknown Type: $value") } @@ -1418,6 +1469,159 @@ private constructor( "BalanceAlertStatus{inAlert=$inAlert, thresholdValue=$thresholdValue, additionalProperties=$additionalProperties}" } + /** Minified license type for alert serialization. */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of() + ) : this(id, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType(checkRequired("id", id), additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "LicenseType{id=$id, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1435,6 +1639,7 @@ private constructor( thresholds == other.thresholds && type == other.type && balanceAlertStatus == other.balanceAlertStatus && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -1451,6 +1656,7 @@ private constructor( thresholds, type, balanceAlertStatus, + licenseType, additionalProperties, ) } @@ -1458,5 +1664,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Alert{id=$id, createdAt=$createdAt, currency=$currency, customer=$customer, enabled=$enabled, metric=$metric, plan=$plan, subscription=$subscription, thresholds=$thresholds, type=$type, balanceAlertStatus=$balanceAlertStatus, additionalProperties=$additionalProperties}" + "Alert{id=$id, createdAt=$createdAt, currency=$currency, customer=$customer, enabled=$enabled, metric=$metric, plan=$plan, subscription=$subscription, thresholds=$thresholds, type=$type, balanceAlertStatus=$balanceAlertStatus, licenseType=$licenseType, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt index ab6fd5234..88898a4d7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt @@ -27,6 +27,7 @@ private constructor( private val currency: JsonField, private val customExpiration: JsonField, private val filters: JsonField>, + private val licenseTypeId: JsonField, private val additionalProperties: MutableMap, ) { @@ -39,8 +40,13 @@ private constructor( @JsonProperty("custom_expiration") @ExcludeMissing customExpiration: JsonField = JsonMissing.of(), - @JsonProperty("filters") @ExcludeMissing filters: JsonField> = JsonMissing.of(), - ) : this(allowsRollover, currency, customExpiration, filters, mutableMapOf()) + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField> = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + ) : this(allowsRollover, currency, customExpiration, filters, licenseTypeId, mutableMapOf()) /** * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly @@ -67,6 +73,12 @@ private constructor( */ fun filters(): Optional> = filters.getOptional("filters") + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * Returns the raw JSON value of [allowsRollover]. * @@ -100,6 +112,15 @@ private constructor( */ @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField> = filters + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -134,6 +155,7 @@ private constructor( private var currency: JsonField? = null private var customExpiration: JsonField? = null private var filters: JsonField>? = null + private var licenseTypeId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -142,6 +164,7 @@ private constructor( currency = allocation.currency customExpiration = allocation.customExpiration filters = allocation.filters.map { it.toMutableList() } + licenseTypeId = allocation.licenseTypeId additionalProperties = allocation.additionalProperties.toMutableMap() } @@ -211,6 +234,24 @@ private constructor( } } + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -250,6 +291,7 @@ private constructor( checkRequired("currency", currency), checkRequired("customExpiration", customExpiration), (filters ?: JsonMissing.of()).map { it.toImmutable() }, + licenseTypeId, additionalProperties.toMutableMap(), ) } @@ -265,6 +307,7 @@ private constructor( currency() customExpiration().ifPresent { it.validate() } filters().ifPresent { it.forEach { it.validate() } } + licenseTypeId() validated = true } @@ -286,7 +329,8 @@ private constructor( (if (allowsRollover.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (customExpiration.asKnown().getOrNull()?.validity() ?: 0) + - (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) class Filter @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -828,15 +872,23 @@ private constructor( currency == other.currency && customExpiration == other.customExpiration && filters == other.filters && + licenseTypeId == other.licenseTypeId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(allowsRollover, currency, customExpiration, filters, additionalProperties) + Objects.hash( + allowsRollover, + currency, + customExpiration, + filters, + licenseTypeId, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Allocation{allowsRollover=$allowsRollover, currency=$currency, customExpiration=$customExpiration, filters=$filters, additionalProperties=$additionalProperties}" + "Allocation{allowsRollover=$allowsRollover, currency=$currency, customExpiration=$customExpiration, filters=$filters, licenseTypeId=$licenseTypeId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt index c52a84d0c..fd05c6dd2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt @@ -3464,6 +3464,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -3522,6 +3523,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -3545,6 +3549,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -3704,6 +3709,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -3873,6 +3886,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -3946,6 +3969,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3969,6 +3993,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -4387,6 +4412,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -4483,6 +4529,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -4516,6 +4563,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -4553,6 +4601,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -5550,6 +5599,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -5573,6 +5623,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -5582,7 +5633,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -5605,6 +5656,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -5664,6 +5716,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -5687,6 +5742,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -5846,6 +5902,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -6015,6 +6079,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -6090,6 +6164,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -6114,6 +6189,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -6534,6 +6610,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -6630,6 +6727,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -6663,6 +6761,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -6702,6 +6801,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -7416,6 +7516,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -7439,6 +7540,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -7448,7 +7550,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -7472,6 +7574,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -7532,6 +7635,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -7555,6 +7661,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -7716,6 +7823,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7885,6 +8000,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7962,6 +8087,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7989,6 +8115,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -8416,6 +8543,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -8515,6 +8663,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -8548,6 +8697,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -8587,6 +8737,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -9209,6 +9360,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -9232,6 +9384,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -9241,7 +9394,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -9265,6 +9418,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -9325,6 +9479,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -9348,6 +9505,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -9509,6 +9667,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -9678,6 +9844,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9755,6 +9931,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9782,6 +9959,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -10209,6 +10387,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -10308,6 +10507,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -10341,6 +10541,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -10380,6 +10581,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -11009,6 +11211,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -11032,6 +11235,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -11041,7 +11245,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -11064,6 +11268,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -11122,6 +11327,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -11145,6 +11353,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -11303,6 +11512,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -11471,6 +11688,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -11544,6 +11771,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -11566,6 +11794,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -11984,6 +12213,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -12080,6 +12330,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -12113,6 +12364,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -12150,6 +12402,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -12619,6 +12872,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -12642,6 +12896,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -12651,7 +12906,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -12674,6 +12929,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -12732,6 +12988,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -12755,6 +13014,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -12914,6 +13174,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -13082,6 +13350,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -13155,6 +13433,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -13177,6 +13456,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -13595,6 +13875,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -13691,6 +13992,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -13724,6 +14026,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -13761,6 +14064,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -14350,6 +14654,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -14373,6 +14678,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -14382,7 +14688,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } @@ -17242,6 +17548,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -17300,6 +17607,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -17323,6 +17633,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -17482,6 +17793,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -17651,6 +17970,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -17724,6 +18053,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -17747,6 +18077,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -18165,6 +18496,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -18261,6 +18613,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -18294,6 +18647,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -18331,6 +18685,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -19328,6 +19683,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -19351,6 +19707,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -19360,7 +19717,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -19383,6 +19740,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -19442,6 +19800,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -19465,6 +19826,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -19624,6 +19986,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -19793,6 +20163,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -19868,6 +20248,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -19892,6 +20273,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -20312,6 +20694,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -20408,6 +20811,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -20441,6 +20845,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -20480,6 +20885,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -21194,6 +21600,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -21217,6 +21624,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -21226,7 +21634,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -21250,6 +21658,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -21310,6 +21719,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -21333,6 +21745,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -21494,6 +21907,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -21663,6 +22084,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -21740,6 +22171,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -21767,6 +22199,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -22194,6 +22627,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -22293,6 +22747,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -22326,6 +22781,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -22365,6 +22821,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -22987,6 +23444,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -23010,6 +23468,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -23019,7 +23478,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -23043,6 +23502,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -23103,6 +23563,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -23126,6 +23589,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -23287,6 +23751,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -23456,6 +23928,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -23533,6 +24015,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -23560,6 +24043,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -23987,6 +24471,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -24086,6 +24591,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -24119,6 +24625,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -24158,6 +24665,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -24787,6 +25295,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -24810,6 +25319,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -24819,7 +25329,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -24842,6 +25352,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -24900,6 +25411,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -24923,6 +25437,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -25081,6 +25596,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -25249,6 +25772,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -25322,6 +25855,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -25344,6 +25878,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -25762,6 +26297,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -25858,6 +26414,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -25891,6 +26448,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -25928,6 +26486,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -26397,6 +26956,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -26420,6 +26980,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -26429,7 +26990,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -26452,6 +27013,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -26510,6 +27072,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -26533,6 +27098,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -26692,6 +27258,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -26860,6 +27434,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -26933,6 +27517,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -26955,6 +27540,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -27373,6 +27959,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -27469,6 +28076,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -27502,6 +28110,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -27539,6 +28148,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -28128,6 +28738,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -28151,6 +28762,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -28160,7 +28772,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParams.kt index 7f3b7ebb3..60eac89dc 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParams.kt @@ -3470,6 +3470,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -3528,6 +3529,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -3551,6 +3555,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -3710,6 +3715,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -3879,6 +3892,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -3952,6 +3975,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3975,6 +3999,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -4393,6 +4418,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -4489,6 +4535,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -4522,6 +4569,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -4559,6 +4607,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -5556,6 +5605,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -5579,6 +5629,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -5588,7 +5639,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -5611,6 +5662,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -5670,6 +5722,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -5693,6 +5748,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -5852,6 +5908,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -6021,6 +6085,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -6096,6 +6170,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -6120,6 +6195,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -6540,6 +6616,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -6636,6 +6733,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -6669,6 +6767,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -6708,6 +6807,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -7422,6 +7522,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -7445,6 +7546,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -7454,7 +7556,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -7478,6 +7580,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -7538,6 +7641,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -7561,6 +7667,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -7722,6 +7829,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7891,6 +8006,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7968,6 +8093,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7995,6 +8121,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -8422,6 +8549,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -8521,6 +8669,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -8554,6 +8703,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -8593,6 +8743,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -9215,6 +9366,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -9238,6 +9390,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -9247,7 +9400,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -9271,6 +9424,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -9331,6 +9485,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -9354,6 +9511,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -9515,6 +9673,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -9684,6 +9850,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9761,6 +9937,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9788,6 +9965,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -10215,6 +10393,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -10314,6 +10513,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -10347,6 +10547,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -10386,6 +10587,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -11015,6 +11217,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -11038,6 +11241,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -11047,7 +11251,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -11070,6 +11274,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -11128,6 +11333,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -11151,6 +11359,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -11309,6 +11518,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -11477,6 +11694,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -11550,6 +11777,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -11572,6 +11800,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -11990,6 +12219,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -12086,6 +12336,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -12119,6 +12370,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -12156,6 +12408,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -12625,6 +12878,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -12648,6 +12902,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -12657,7 +12912,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -12680,6 +12935,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -12738,6 +12994,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -12761,6 +13020,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -12920,6 +13180,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -13088,6 +13356,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -13161,6 +13439,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -13183,6 +13462,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -13601,6 +13881,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -13697,6 +13998,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -13730,6 +14032,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -13767,6 +14070,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -14356,6 +14660,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -14379,6 +14684,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -14388,7 +14694,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } @@ -17248,6 +17554,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -17306,6 +17613,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -17329,6 +17639,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -17488,6 +17799,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -17657,6 +17976,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -17730,6 +18059,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -17753,6 +18083,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -18171,6 +18502,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -18267,6 +18619,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -18300,6 +18653,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -18337,6 +18691,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -19334,6 +19689,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -19357,6 +19713,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -19366,7 +19723,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -19389,6 +19746,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -19448,6 +19806,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -19471,6 +19832,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -19630,6 +19992,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -19799,6 +20169,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -19874,6 +20254,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -19898,6 +20279,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -20318,6 +20700,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -20414,6 +20817,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -20447,6 +20851,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -20486,6 +20891,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -21200,6 +21606,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -21223,6 +21630,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -21232,7 +21640,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -21256,6 +21664,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -21316,6 +21725,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -21339,6 +21751,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -21500,6 +21913,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -21669,6 +22090,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -21746,6 +22177,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -21773,6 +22205,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -22200,6 +22633,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -22299,6 +22753,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -22332,6 +22787,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -22371,6 +22827,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -22993,6 +23450,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -23016,6 +23474,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -23025,7 +23484,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -23049,6 +23508,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -23109,6 +23569,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -23132,6 +23595,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -23293,6 +23757,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -23462,6 +23934,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -23539,6 +24021,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -23566,6 +24049,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -23993,6 +24477,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -24092,6 +24597,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -24125,6 +24631,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -24164,6 +24671,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -24793,6 +25301,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -24816,6 +25325,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -24825,7 +25335,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -24848,6 +25358,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -24906,6 +25417,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -24929,6 +25443,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -25087,6 +25602,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -25255,6 +25778,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -25328,6 +25861,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -25350,6 +25884,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -25768,6 +26303,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -25864,6 +26420,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -25897,6 +26454,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -25934,6 +26492,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -26403,6 +26962,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -26426,6 +26986,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -26435,7 +26996,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -26458,6 +27019,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -26516,6 +27078,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -26539,6 +27104,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -26698,6 +27264,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -26866,6 +27440,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -26939,6 +27523,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -26961,6 +27546,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -27379,6 +27965,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -27475,6 +28082,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -27508,6 +28116,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -27545,6 +28154,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -28134,6 +28744,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -28157,6 +28768,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -28166,7 +28778,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } 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 b06b0d7cc..133b1d8a8 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.ExcludeMissing import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown import com.withorb.api.core.checkRequired import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException @@ -32,6 +33,7 @@ private constructor( private val metadata: JsonField, private val name: JsonField, private val status: JsonField, + private val parameterDefinitions: JsonField>, private val additionalProperties: MutableMap, ) { @@ -45,7 +47,10 @@ private constructor( @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), - ) : this(id, description, item, metadata, name, status, mutableMapOf()) + @JsonProperty("parameter_definitions") + @ExcludeMissing + parameterDefinitions: JsonField> = JsonMissing.of(), + ) : this(id, description, item, metadata, name, status, parameterDefinitions, mutableMapOf()) /** * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly @@ -91,6 +96,13 @@ private constructor( */ fun status(): Status = status.getRequired("status") + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun parameterDefinitions(): Optional> = + parameterDefinitions.getOptional("parameter_definitions") + /** * Returns the raw JSON value of [id]. * @@ -133,6 +145,16 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** + * Returns the raw JSON value of [parameterDefinitions]. + * + * Unlike [parameterDefinitions], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("parameter_definitions") + @ExcludeMissing + fun _parameterDefinitions(): JsonField> = parameterDefinitions + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -172,6 +194,7 @@ private constructor( private var metadata: JsonField? = null private var name: JsonField? = null private var status: JsonField? = null + private var parameterDefinitions: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -182,6 +205,7 @@ private constructor( metadata = billableMetric.metadata name = billableMetric.name status = billableMetric.status + parameterDefinitions = billableMetric.parameterDefinitions.map { it.toMutableList() } additionalProperties = billableMetric.additionalProperties.toMutableMap() } @@ -260,6 +284,40 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } + fun parameterDefinitions(parameterDefinitions: List?) = + parameterDefinitions(JsonField.ofNullable(parameterDefinitions)) + + /** + * Alias for calling [Builder.parameterDefinitions] with + * `parameterDefinitions.orElse(null)`. + */ + fun parameterDefinitions(parameterDefinitions: Optional>) = + parameterDefinitions(parameterDefinitions.getOrNull()) + + /** + * Sets [Builder.parameterDefinitions] to an arbitrary JSON value. + * + * You should usually call [Builder.parameterDefinitions] with a well-typed + * `List` value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun parameterDefinitions(parameterDefinitions: JsonField>) = + apply { + this.parameterDefinitions = parameterDefinitions.map { it.toMutableList() } + } + + /** + * Adds a single [ParameterDefinition] to [parameterDefinitions]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addParameterDefinition(parameterDefinition: ParameterDefinition) = apply { + parameterDefinitions = + (parameterDefinitions ?: JsonField.of(mutableListOf())).also { + checkKnown("parameterDefinitions", it).add(parameterDefinition) + } + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -304,6 +362,7 @@ private constructor( checkRequired("metadata", metadata), checkRequired("name", name), checkRequired("status", status), + (parameterDefinitions ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) } @@ -321,6 +380,7 @@ private constructor( metadata().validate() name() status().validate() + parameterDefinitions().ifPresent { it.forEach { it.validate() } } validated = true } @@ -344,7 +404,8 @@ private constructor( (item.asKnown().getOrNull()?.validity() ?: 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + - (status.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + + (parameterDefinitions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) /** * User specified key-value pairs for the resource. If not present, this defaults to an empty @@ -580,6 +641,107 @@ private constructor( override fun toString() = value.toString() } + class ParameterDefinition + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [ParameterDefinition]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ParameterDefinition]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(parameterDefinition: ParameterDefinition) = apply { + additionalProperties = parameterDefinition.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) + } + + /** + * Returns an immutable instance of [ParameterDefinition]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ParameterDefinition = + ParameterDefinition(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): ParameterDefinition = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ParameterDefinition && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "ParameterDefinition{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -592,15 +754,25 @@ private constructor( metadata == other.metadata && name == other.name && status == other.status && + parameterDefinitions == other.parameterDefinitions && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(id, description, item, metadata, name, status, additionalProperties) + Objects.hash( + id, + description, + item, + metadata, + name, + status, + parameterDefinitions, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "BillableMetric{id=$id, description=$description, item=$item, metadata=$metadata, name=$name, status=$status, additionalProperties=$additionalProperties}" + "BillableMetric{id=$id, description=$description, item=$item, metadata=$metadata, name=$name, status=$status, parameterDefinitions=$parameterDefinitions, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ChangedSubscriptionResources.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ChangedSubscriptionResources.kt index 6e3c85721..3f6180241 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ChangedSubscriptionResources.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ChangedSubscriptionResources.kt @@ -742,6 +742,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -790,6 +791,11 @@ private constructor( * This field is deprecated in favor of `discounts`. If a `discounts` list is provided, the * first discount in the list will be returned. If the list is empty, `None` will be * returned. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = createdInvoice.discount().convert(MyClass.class); + * ``` */ @Deprecated("deprecated") @JsonProperty("discount") @@ -1840,6 +1846,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockListInvoicesParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockListInvoicesParams.kt new file mode 100644 index 000000000..a8bd589e1 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockListInvoicesParams.kt @@ -0,0 +1,209 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.Params +import com.withorb.api.core.http.Headers +import com.withorb.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * This endpoint returns the credit block and its associated purchasing invoices. + * + * If a credit block was purchased (as opposed to being manually added or allocated from a + * subscription), this endpoint returns the invoices that were created to charge the customer for + * the credit block. For credit blocks with payment schedules spanning multiple periods (e.g., + * monthly payments over 12 months), multiple invoices will be returned. + * + * If the credit block was not purchased (e.g., manual increment, allocation), an empty invoices + * list is returned. + * + * **Note: This endpoint is currently experimental and its interface may change in future releases. + * Please contact support before building production integrations against this endpoint.** + */ +class CreditBlockListInvoicesParams +private constructor( + private val blockId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun blockId(): Optional = Optional.ofNullable(blockId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): CreditBlockListInvoicesParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [CreditBlockListInvoicesParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditBlockListInvoicesParams]. */ + class Builder internal constructor() { + + private var blockId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(creditBlockListInvoicesParams: CreditBlockListInvoicesParams) = apply { + blockId = creditBlockListInvoicesParams.blockId + additionalHeaders = creditBlockListInvoicesParams.additionalHeaders.toBuilder() + additionalQueryParams = creditBlockListInvoicesParams.additionalQueryParams.toBuilder() + } + + fun blockId(blockId: String?) = apply { this.blockId = blockId } + + /** Alias for calling [Builder.blockId] with `blockId.orElse(null)`. */ + fun blockId(blockId: Optional) = blockId(blockId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [CreditBlockListInvoicesParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): CreditBlockListInvoicesParams = + CreditBlockListInvoicesParams( + blockId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> blockId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditBlockListInvoicesParams && + blockId == other.blockId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(blockId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "CreditBlockListInvoicesParams{blockId=$blockId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockListInvoicesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockListInvoicesResponse.kt new file mode 100644 index 000000000..2bdb76193 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockListInvoicesResponse.kt @@ -0,0 +1,2023 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class CreditBlockListInvoicesResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val block: JsonField, + private val invoices: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("block") @ExcludeMissing block: JsonField = JsonMissing.of(), + @JsonProperty("invoices") + @ExcludeMissing + invoices: JsonField> = JsonMissing.of(), + ) : this(block, invoices, mutableMapOf()) + + /** + * The Credit Block resource models prepaid credits within Orb. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun block(): Block = block.getRequired("block") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun invoices(): List = invoices.getRequired("invoices") + + /** + * Returns the raw JSON value of [block]. + * + * Unlike [block], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("block") @ExcludeMissing fun _block(): JsonField = block + + /** + * Returns the raw JSON value of [invoices]. + * + * Unlike [invoices], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("invoices") @ExcludeMissing fun _invoices(): JsonField> = invoices + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CreditBlockListInvoicesResponse]. + * + * The following fields are required: + * ```java + * .block() + * .invoices() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditBlockListInvoicesResponse]. */ + class Builder internal constructor() { + + private var block: JsonField? = null + private var invoices: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(creditBlockListInvoicesResponse: CreditBlockListInvoicesResponse) = + apply { + block = creditBlockListInvoicesResponse.block + invoices = creditBlockListInvoicesResponse.invoices.map { it.toMutableList() } + additionalProperties = + creditBlockListInvoicesResponse.additionalProperties.toMutableMap() + } + + /** The Credit Block resource models prepaid credits within Orb. */ + fun block(block: Block) = block(JsonField.of(block)) + + /** + * Sets [Builder.block] to an arbitrary JSON value. + * + * You should usually call [Builder.block] with a well-typed [Block] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun block(block: JsonField) = apply { this.block = block } + + fun invoices(invoices: List) = invoices(JsonField.of(invoices)) + + /** + * Sets [Builder.invoices] to an arbitrary JSON value. + * + * You should usually call [Builder.invoices] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun invoices(invoices: JsonField>) = apply { + this.invoices = invoices.map { it.toMutableList() } + } + + /** + * Adds a single [Invoice] to [invoices]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addInvoice(invoice: Invoice) = apply { + invoices = + (invoices ?: JsonField.of(mutableListOf())).also { + checkKnown("invoices", it).add(invoice) + } + } + + 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) + } + + /** + * Returns an immutable instance of [CreditBlockListInvoicesResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .block() + * .invoices() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreditBlockListInvoicesResponse = + CreditBlockListInvoicesResponse( + checkRequired("block", block), + checkRequired("invoices", invoices).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreditBlockListInvoicesResponse = apply { + if (validated) { + return@apply + } + + block().validate() + invoices().forEach { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (block.asKnown().getOrNull()?.validity() ?: 0) + + (invoices.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + /** The Credit Block resource models prepaid credits within Orb. */ + class Block + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val balance: JsonField, + private val effectiveDate: JsonField, + private val expiryDate: JsonField, + private val filters: JsonField>, + private val maximumInitialBalance: JsonField, + private val metadata: JsonField, + private val perUnitCostBasis: JsonField, + private val status: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("balance") @ExcludeMissing balance: JsonField = JsonMissing.of(), + @JsonProperty("effective_date") + @ExcludeMissing + effectiveDate: JsonField = JsonMissing.of(), + @JsonProperty("expiry_date") + @ExcludeMissing + expiryDate: JsonField = JsonMissing.of(), + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField> = JsonMissing.of(), + @JsonProperty("maximum_initial_balance") + @ExcludeMissing + maximumInitialBalance: JsonField = JsonMissing.of(), + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("per_unit_cost_basis") + @ExcludeMissing + perUnitCostBasis: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + ) : this( + id, + balance, + effectiveDate, + expiryDate, + filters, + maximumInitialBalance, + metadata, + perUnitCostBasis, + status, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun balance(): Double = balance.getRequired("balance") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun effectiveDate(): Optional = effectiveDate.getOptional("effective_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun expiryDate(): Optional = expiryDate.getOptional("expiry_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun filters(): List = filters.getRequired("filters") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun maximumInitialBalance(): Optional = + maximumInitialBalance.getOptional("maximum_initial_balance") + + /** + * 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`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): Metadata = metadata.getRequired("metadata") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun perUnitCostBasis(): Optional = + perUnitCostBasis.getOptional("per_unit_cost_basis") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [balance]. + * + * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance + + /** + * Returns the raw JSON value of [effectiveDate]. + * + * Unlike [effectiveDate], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("effective_date") + @ExcludeMissing + fun _effectiveDate(): JsonField = effectiveDate + + /** + * Returns the raw JSON value of [expiryDate]. + * + * Unlike [expiryDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("expiry_date") + @ExcludeMissing + fun _expiryDate(): JsonField = expiryDate + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField> = filters + + /** + * Returns the raw JSON value of [maximumInitialBalance]. + * + * Unlike [maximumInitialBalance], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("maximum_initial_balance") + @ExcludeMissing + fun _maximumInitialBalance(): JsonField = maximumInitialBalance + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [perUnitCostBasis]. + * + * Unlike [perUnitCostBasis], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("per_unit_cost_basis") + @ExcludeMissing + fun _perUnitCostBasis(): JsonField = perUnitCostBasis + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Block]. + * + * The following fields are required: + * ```java + * .id() + * .balance() + * .effectiveDate() + * .expiryDate() + * .filters() + * .maximumInitialBalance() + * .metadata() + * .perUnitCostBasis() + * .status() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Block]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var balance: JsonField? = null + private var effectiveDate: JsonField? = null + private var expiryDate: JsonField? = null + private var filters: JsonField>? = null + private var maximumInitialBalance: JsonField? = null + private var metadata: JsonField? = null + private var perUnitCostBasis: JsonField? = null + private var status: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(block: Block) = apply { + id = block.id + balance = block.balance + effectiveDate = block.effectiveDate + expiryDate = block.expiryDate + filters = block.filters.map { it.toMutableList() } + maximumInitialBalance = block.maximumInitialBalance + metadata = block.metadata + perUnitCostBasis = block.perUnitCostBasis + status = block.status + additionalProperties = block.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun balance(balance: Double) = balance(JsonField.of(balance)) + + /** + * Sets [Builder.balance] to an arbitrary JSON value. + * + * You should usually call [Builder.balance] with a well-typed [Double] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun balance(balance: JsonField) = apply { this.balance = balance } + + fun effectiveDate(effectiveDate: OffsetDateTime?) = + effectiveDate(JsonField.ofNullable(effectiveDate)) + + /** Alias for calling [Builder.effectiveDate] with `effectiveDate.orElse(null)`. */ + fun effectiveDate(effectiveDate: Optional) = + effectiveDate(effectiveDate.getOrNull()) + + /** + * Sets [Builder.effectiveDate] to an arbitrary JSON value. + * + * You should usually call [Builder.effectiveDate] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun effectiveDate(effectiveDate: JsonField) = apply { + this.effectiveDate = effectiveDate + } + + fun expiryDate(expiryDate: OffsetDateTime?) = + expiryDate(JsonField.ofNullable(expiryDate)) + + /** Alias for calling [Builder.expiryDate] with `expiryDate.orElse(null)`. */ + fun expiryDate(expiryDate: Optional) = + expiryDate(expiryDate.getOrNull()) + + /** + * Sets [Builder.expiryDate] to an arbitrary JSON value. + * + * You should usually call [Builder.expiryDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun expiryDate(expiryDate: JsonField) = apply { + this.expiryDate = expiryDate + } + + fun filters(filters: List) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField>) = apply { + this.filters = filters.map { it.toMutableList() } + } + + /** + * Adds a single [Filter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: Filter) = apply { + filters = + (filters ?: JsonField.of(mutableListOf())).also { + checkKnown("filters", it).add(filter) + } + } + + fun maximumInitialBalance(maximumInitialBalance: Double?) = + maximumInitialBalance(JsonField.ofNullable(maximumInitialBalance)) + + /** + * Alias for [Builder.maximumInitialBalance]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun maximumInitialBalance(maximumInitialBalance: Double) = + maximumInitialBalance(maximumInitialBalance as Double?) + + /** + * Alias for calling [Builder.maximumInitialBalance] with + * `maximumInitialBalance.orElse(null)`. + */ + fun maximumInitialBalance(maximumInitialBalance: Optional) = + maximumInitialBalance(maximumInitialBalance.getOrNull()) + + /** + * Sets [Builder.maximumInitialBalance] to an arbitrary JSON value. + * + * You should usually call [Builder.maximumInitialBalance] with a well-typed [Double] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun maximumInitialBalance(maximumInitialBalance: JsonField) = apply { + this.maximumInitialBalance = maximumInitialBalance + } + + /** + * 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)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + fun perUnitCostBasis(perUnitCostBasis: String?) = + perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) + + /** + * Alias for calling [Builder.perUnitCostBasis] with `perUnitCostBasis.orElse(null)`. + */ + fun perUnitCostBasis(perUnitCostBasis: Optional) = + perUnitCostBasis(perUnitCostBasis.getOrNull()) + + /** + * Sets [Builder.perUnitCostBasis] to an arbitrary JSON value. + * + * You should usually call [Builder.perUnitCostBasis] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { + this.perUnitCostBasis = perUnitCostBasis + } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + 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) + } + + /** + * Returns an immutable instance of [Block]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .balance() + * .effectiveDate() + * .expiryDate() + * .filters() + * .maximumInitialBalance() + * .metadata() + * .perUnitCostBasis() + * .status() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Block = + Block( + checkRequired("id", id), + checkRequired("balance", balance), + checkRequired("effectiveDate", effectiveDate), + checkRequired("expiryDate", expiryDate), + checkRequired("filters", filters).map { it.toImmutable() }, + checkRequired("maximumInitialBalance", maximumInitialBalance), + checkRequired("metadata", metadata), + checkRequired("perUnitCostBasis", perUnitCostBasis), + checkRequired("status", status), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Block = apply { + if (validated) { + return@apply + } + + id() + balance() + effectiveDate() + expiryDate() + filters().forEach { it.validate() } + maximumInitialBalance() + metadata().validate() + perUnitCostBasis() + status().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (balance.asKnown().isPresent) 1 else 0) + + (if (effectiveDate.asKnown().isPresent) 1 else 0) + + (if (expiryDate.asKnown().isPresent) 1 else 0) + + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (maximumInitialBalance.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (if (perUnitCostBasis.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + class Filter + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val field: JsonField, + private val operator: JsonField, + private val values: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("field") @ExcludeMissing field: JsonField = JsonMissing.of(), + @JsonProperty("operator") + @ExcludeMissing + operator: JsonField = JsonMissing.of(), + @JsonProperty("values") + @ExcludeMissing + values: JsonField> = JsonMissing.of(), + ) : this(field, operator, values, mutableMapOf()) + + /** + * The property of the price to filter on. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun field(): Field = field.getRequired("field") + + /** + * Should prices that match the filter be included or excluded. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun operator(): Operator = operator.getRequired("operator") + + /** + * The IDs or values that match this filter. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun values(): List = values.getRequired("values") + + /** + * Returns the raw JSON value of [field]. + * + * Unlike [field], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("field") @ExcludeMissing fun _field(): JsonField = field + + /** + * Returns the raw JSON value of [operator]. + * + * Unlike [operator], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("operator") + @ExcludeMissing + fun _operator(): JsonField = operator + + /** + * Returns the raw JSON value of [values]. + * + * Unlike [values], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("values") @ExcludeMissing fun _values(): JsonField> = values + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Filter]. + * + * The following fields are required: + * ```java + * .field() + * .operator() + * .values() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Filter]. */ + class Builder internal constructor() { + + private var field: JsonField? = null + private var operator: JsonField? = null + private var values: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(filter: Filter) = apply { + field = filter.field + operator = filter.operator + values = filter.values.map { it.toMutableList() } + additionalProperties = filter.additionalProperties.toMutableMap() + } + + /** The property of the price to filter on. */ + fun field(field: Field) = field(JsonField.of(field)) + + /** + * Sets [Builder.field] to an arbitrary JSON value. + * + * You should usually call [Builder.field] with a well-typed [Field] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun field(field: JsonField) = apply { this.field = field } + + /** Should prices that match the filter be included or excluded. */ + fun operator(operator: Operator) = operator(JsonField.of(operator)) + + /** + * Sets [Builder.operator] to an arbitrary JSON value. + * + * You should usually call [Builder.operator] with a well-typed [Operator] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun operator(operator: JsonField) = apply { this.operator = operator } + + /** The IDs or values that match this filter. */ + fun values(values: List) = values(JsonField.of(values)) + + /** + * Sets [Builder.values] to an arbitrary JSON value. + * + * You should usually call [Builder.values] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun values(values: JsonField>) = apply { + this.values = values.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [values]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addValue(value: String) = apply { + values = + (values ?: JsonField.of(mutableListOf())).also { + checkKnown("values", it).add(value) + } + } + + 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) + } + + /** + * Returns an immutable instance of [Filter]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .field() + * .operator() + * .values() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Filter = + Filter( + checkRequired("field", field), + checkRequired("operator", operator), + checkRequired("values", values).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Filter = apply { + if (validated) { + return@apply + } + + field().validate() + operator().validate() + values() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (field.asKnown().getOrNull()?.validity() ?: 0) + + (operator.asKnown().getOrNull()?.validity() ?: 0) + + (values.asKnown().getOrNull()?.size ?: 0) + + /** The property of the price to filter on. */ + class Field @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 PRICE_ID = of("price_id") + + @JvmField val ITEM_ID = of("item_id") + + @JvmField val PRICE_TYPE = of("price_type") + + @JvmField val CURRENCY = of("currency") + + @JvmField val PRICING_UNIT_ID = of("pricing_unit_id") + + @JvmStatic fun of(value: String) = Field(JsonField.of(value)) + } + + /** An enum containing [Field]'s known values. */ + enum class Known { + PRICE_ID, + ITEM_ID, + PRICE_TYPE, + CURRENCY, + PRICING_UNIT_ID, + } + + /** + * An enum containing [Field]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Field] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PRICE_ID, + ITEM_ID, + PRICE_TYPE, + CURRENCY, + PRICING_UNIT_ID, + /** + * An enum member indicating that [Field] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PRICE_ID -> Value.PRICE_ID + ITEM_ID -> Value.ITEM_ID + PRICE_TYPE -> Value.PRICE_TYPE + CURRENCY -> Value.CURRENCY + PRICING_UNIT_ID -> Value.PRICING_UNIT_ID + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + PRICE_ID -> Known.PRICE_ID + ITEM_ID -> Known.ITEM_ID + PRICE_TYPE -> Known.PRICE_TYPE + CURRENCY -> Known.CURRENCY + PRICING_UNIT_ID -> Known.PRICING_UNIT_ID + else -> throw OrbInvalidDataException("Unknown Field: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OrbInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Field = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Field && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Should prices that match the filter be included or excluded. */ + class Operator @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 INCLUDES = of("includes") + + @JvmField val EXCLUDES = of("excludes") + + @JvmStatic fun of(value: String) = Operator(JsonField.of(value)) + } + + /** An enum containing [Operator]'s known values. */ + enum class Known { + INCLUDES, + EXCLUDES, + } + + /** + * An enum containing [Operator]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Operator] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + INCLUDES, + EXCLUDES, + /** + * An enum member indicating that [Operator] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + INCLUDES -> Value.INCLUDES + EXCLUDES -> Value.EXCLUDES + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + INCLUDES -> Known.INCLUDES + EXCLUDES -> Known.EXCLUDES + else -> throw OrbInvalidDataException("Unknown Operator: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OrbInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Operator = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Operator && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Filter && + field == other.field && + operator == other.operator && + values == other.values && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(field, operator, values, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Filter{field=$field, operator=$operator, values=$values, 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`. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @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) + } + + /** + * Returns an immutable instance of [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + + class Status @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 ACTIVE = of("active") + + @JvmField val PENDING_PAYMENT = of("pending_payment") + + @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 + PENDING_PAYMENT -> Value.PENDING_PAYMENT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to 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 + PENDING_PAYMENT -> Known.PENDING_PAYMENT + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Block && + id == other.id && + balance == other.balance && + effectiveDate == other.effectiveDate && + expiryDate == other.expiryDate && + filters == other.filters && + maximumInitialBalance == other.maximumInitialBalance && + metadata == other.metadata && + perUnitCostBasis == other.perUnitCostBasis && + status == other.status && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + balance, + effectiveDate, + expiryDate, + filters, + maximumInitialBalance, + metadata, + perUnitCostBasis, + status, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Block{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, metadata=$metadata, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" + } + + class Invoice + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val customer: JsonField, + private val invoiceNumber: JsonField, + private val status: JsonField, + private val subscription: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("customer") + @ExcludeMissing + customer: JsonField = JsonMissing.of(), + @JsonProperty("invoice_number") + @ExcludeMissing + invoiceNumber: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription") + @ExcludeMissing + subscription: JsonField = JsonMissing.of(), + ) : this(id, customer, invoiceNumber, status, subscription, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun customer(): CustomerMinified = customer.getRequired("customer") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun invoiceNumber(): String = invoiceNumber.getRequired("invoice_number") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun subscription(): Optional = + subscription.getOptional("subscription") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [customer]. + * + * Unlike [customer], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("customer") + @ExcludeMissing + fun _customer(): JsonField = customer + + /** + * Returns the raw JSON value of [invoiceNumber]. + * + * Unlike [invoiceNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("invoice_number") + @ExcludeMissing + fun _invoiceNumber(): JsonField = invoiceNumber + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscription]. + * + * Unlike [subscription], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("subscription") + @ExcludeMissing + fun _subscription(): JsonField = subscription + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Invoice]. + * + * The following fields are required: + * ```java + * .id() + * .customer() + * .invoiceNumber() + * .status() + * .subscription() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Invoice]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var customer: JsonField? = null + private var invoiceNumber: JsonField? = null + private var status: JsonField? = null + private var subscription: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(invoice: Invoice) = apply { + id = invoice.id + customer = invoice.customer + invoiceNumber = invoice.invoiceNumber + status = invoice.status + subscription = invoice.subscription + additionalProperties = invoice.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun customer(customer: CustomerMinified) = customer(JsonField.of(customer)) + + /** + * Sets [Builder.customer] to an arbitrary JSON value. + * + * You should usually call [Builder.customer] with a well-typed [CustomerMinified] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun customer(customer: JsonField) = apply { this.customer = customer } + + fun invoiceNumber(invoiceNumber: String) = invoiceNumber(JsonField.of(invoiceNumber)) + + /** + * Sets [Builder.invoiceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.invoiceNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun invoiceNumber(invoiceNumber: JsonField) = apply { + this.invoiceNumber = invoiceNumber + } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscription(subscription: SubscriptionMinified?) = + subscription(JsonField.ofNullable(subscription)) + + /** Alias for calling [Builder.subscription] with `subscription.orElse(null)`. */ + fun subscription(subscription: Optional) = + subscription(subscription.getOrNull()) + + /** + * Sets [Builder.subscription] to an arbitrary JSON value. + * + * You should usually call [Builder.subscription] with a well-typed + * [SubscriptionMinified] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun subscription(subscription: JsonField) = apply { + this.subscription = subscription + } + + 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) + } + + /** + * Returns an immutable instance of [Invoice]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .customer() + * .invoiceNumber() + * .status() + * .subscription() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Invoice = + Invoice( + checkRequired("id", id), + checkRequired("customer", customer), + checkRequired("invoiceNumber", invoiceNumber), + checkRequired("status", status), + checkRequired("subscription", subscription), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Invoice = apply { + if (validated) { + return@apply + } + + id() + customer().validate() + invoiceNumber() + status().validate() + subscription().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (customer.asKnown().getOrNull()?.validity() ?: 0) + + (if (invoiceNumber.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (subscription.asKnown().getOrNull()?.validity() ?: 0) + + class Status @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 ISSUED = of("issued") + + @JvmField val PAID = of("paid") + + @JvmField val SYNCED = of("synced") + + @JvmField val VOID = of("void") + + @JvmField val DRAFT = of("draft") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ISSUED, + PAID, + SYNCED, + VOID, + 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 + PAID -> Value.PAID + SYNCED -> Value.SYNCED + VOID -> Value.VOID + DRAFT -> Value.DRAFT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to 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 + PAID -> Known.PAID + SYNCED -> Known.SYNCED + VOID -> Known.VOID + DRAFT -> Known.DRAFT + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Invoice && + id == other.id && + customer == other.customer && + invoiceNumber == other.invoiceNumber && + status == other.status && + subscription == other.subscription && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, customer, invoiceNumber, status, subscription, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Invoice{id=$id, customer=$customer, invoiceNumber=$invoiceNumber, status=$status, subscription=$subscription, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditBlockListInvoicesResponse && + block == other.block && + invoices == other.invoices && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(block, invoices, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditBlockListInvoicesResponse{block=$block, invoices=$invoices, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockRetrieveResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockRetrieveResponse.kt index bbc248c0e..6f4dce4dc 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockRetrieveResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditBlockRetrieveResponse.kt @@ -31,6 +31,7 @@ private constructor( private val expiryDate: JsonField, private val filters: JsonField>, private val maximumInitialBalance: JsonField, + private val metadata: JsonField, private val perUnitCostBasis: JsonField, private val status: JsonField, private val additionalProperties: MutableMap, @@ -52,6 +53,7 @@ private constructor( @JsonProperty("maximum_initial_balance") @ExcludeMissing maximumInitialBalance: JsonField = JsonMissing.of(), + @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("per_unit_cost_basis") @ExcludeMissing perUnitCostBasis: JsonField = JsonMissing.of(), @@ -63,6 +65,7 @@ private constructor( expiryDate, filters, maximumInitialBalance, + metadata, perUnitCostBasis, status, mutableMapOf(), @@ -105,6 +108,16 @@ private constructor( fun maximumInitialBalance(): Optional = maximumInitialBalance.getOptional("maximum_initial_balance") + /** + * 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`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): Metadata = metadata.getRequired("metadata") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server * responded with an unexpected value). @@ -166,6 +179,13 @@ private constructor( @ExcludeMissing fun _maximumInitialBalance(): JsonField = maximumInitialBalance + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + /** * Returns the raw JSON value of [perUnitCostBasis]. * @@ -208,6 +228,7 @@ private constructor( * .expiryDate() * .filters() * .maximumInitialBalance() + * .metadata() * .perUnitCostBasis() * .status() * ``` @@ -224,6 +245,7 @@ private constructor( private var expiryDate: JsonField? = null private var filters: JsonField>? = null private var maximumInitialBalance: JsonField? = null + private var metadata: JsonField? = null private var perUnitCostBasis: JsonField? = null private var status: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -236,6 +258,7 @@ private constructor( expiryDate = creditBlockRetrieveResponse.expiryDate filters = creditBlockRetrieveResponse.filters.map { it.toMutableList() } maximumInitialBalance = creditBlockRetrieveResponse.maximumInitialBalance + metadata = creditBlockRetrieveResponse.metadata perUnitCostBasis = creditBlockRetrieveResponse.perUnitCostBasis status = creditBlockRetrieveResponse.status additionalProperties = creditBlockRetrieveResponse.additionalProperties.toMutableMap() @@ -349,6 +372,22 @@ private constructor( this.maximumInitialBalance = maximumInitialBalance } + /** + * 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)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + fun perUnitCostBasis(perUnitCostBasis: String?) = perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) @@ -409,6 +448,7 @@ private constructor( * .expiryDate() * .filters() * .maximumInitialBalance() + * .metadata() * .perUnitCostBasis() * .status() * ``` @@ -423,6 +463,7 @@ private constructor( checkRequired("expiryDate", expiryDate), checkRequired("filters", filters).map { it.toImmutable() }, checkRequired("maximumInitialBalance", maximumInitialBalance), + checkRequired("metadata", metadata), checkRequired("perUnitCostBasis", perUnitCostBasis), checkRequired("status", status), additionalProperties.toMutableMap(), @@ -442,6 +483,7 @@ private constructor( expiryDate() filters().forEach { it.validate() } maximumInitialBalance() + metadata().validate() perUnitCostBasis() status().validate() validated = true @@ -468,6 +510,7 @@ private constructor( (if (expiryDate.asKnown().isPresent) 1 else 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (maximumInitialBalance.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (perUnitCostBasis.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) @@ -1001,6 +1044,110 @@ private constructor( "Filter{field=$field, operator=$operator, values=$values, 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`. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @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) + } + + /** + * Returns an immutable instance of [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -1137,6 +1284,7 @@ private constructor( expiryDate == other.expiryDate && filters == other.filters && maximumInitialBalance == other.maximumInitialBalance && + metadata == other.metadata && perUnitCostBasis == other.perUnitCostBasis && status == other.status && additionalProperties == other.additionalProperties @@ -1150,6 +1298,7 @@ private constructor( expiryDate, filters, maximumInitialBalance, + metadata, perUnitCostBasis, status, additionalProperties, @@ -1159,5 +1308,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CreditBlockRetrieveResponse{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" + "CreditBlockRetrieveResponse{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, metadata=$metadata, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" } 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 856fcb04e..f502ea5b9 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 @@ -408,6 +408,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1248,6 +1249,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | 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 702f26ece..45e7624f3 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 @@ -308,6 +308,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1167,6 +1168,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1752,6 +1754,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -2686,6 +2689,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | 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 db2e67796..67643792b 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 @@ -78,7 +78,8 @@ import kotlin.jvm.optionals.getOrNull * pass `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for * the customer for the credits pre-purchase. Note that you _must_ provide the * `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the - * cost basis with the number of credit units added. + * cost basis with the number of credit units added. Additionally, Orb also enforces invoice + * generation when a non-zero `per_unit_cost_basis` value is provided. * * ## Deducting Credits * Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb @@ -1786,6 +1787,7 @@ private constructor( private val customDueDate: JsonField, private val invoiceDate: JsonField, private val itemId: JsonField, + private val markAsPaid: JsonField, private val memo: JsonField, private val netTerms: JsonField, private val requireSuccessfulPayment: JsonField, @@ -1806,6 +1808,9 @@ private constructor( @JsonProperty("item_id") @ExcludeMissing itemId: JsonField = JsonMissing.of(), + @JsonProperty("mark_as_paid") + @ExcludeMissing + markAsPaid: JsonField = JsonMissing.of(), @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(), @@ -1820,6 +1825,7 @@ private constructor( customDueDate, invoiceDate, itemId, + markAsPaid, memo, netTerms, requireSuccessfulPayment, @@ -1865,6 +1871,14 @@ private constructor( */ fun itemId(): Optional = itemId.getOptional("item_id") + /** + * If true, the new credits purchase invoice will be marked as paid. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun markAsPaid(): Optional = markAsPaid.getOptional("mark_as_paid") + /** * An optional memo to display on the invoice. * @@ -1933,6 +1947,16 @@ private constructor( */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + /** + * Returns the raw JSON value of [markAsPaid]. + * + * Unlike [markAsPaid], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("mark_as_paid") + @ExcludeMissing + fun _markAsPaid(): JsonField = markAsPaid + /** * Returns the raw JSON value of [memo]. * @@ -1993,6 +2017,7 @@ private constructor( private var customDueDate: JsonField = JsonMissing.of() private var invoiceDate: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() + private var markAsPaid: JsonField = JsonMissing.of() private var memo: JsonField = JsonMissing.of() private var netTerms: JsonField = JsonMissing.of() private var requireSuccessfulPayment: JsonField = JsonMissing.of() @@ -2004,6 +2029,7 @@ private constructor( customDueDate = invoiceSettings.customDueDate invoiceDate = invoiceSettings.invoiceDate itemId = invoiceSettings.itemId + markAsPaid = invoiceSettings.markAsPaid memo = invoiceSettings.memo netTerms = invoiceSettings.netTerms requireSuccessfulPayment = invoiceSettings.requireSuccessfulPayment @@ -2109,6 +2135,20 @@ private constructor( */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + /** If true, the new credits purchase invoice will be marked as paid. */ + fun markAsPaid(markAsPaid: Boolean) = markAsPaid(JsonField.of(markAsPaid)) + + /** + * Sets [Builder.markAsPaid] to an arbitrary JSON value. + * + * You should usually call [Builder.markAsPaid] with a well-typed [Boolean] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun markAsPaid(markAsPaid: JsonField) = apply { + this.markAsPaid = markAsPaid + } + /** An optional memo to display on the invoice. */ fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) @@ -2212,6 +2252,7 @@ private constructor( customDueDate, invoiceDate, itemId, + markAsPaid, memo, netTerms, requireSuccessfulPayment, @@ -2230,6 +2271,7 @@ private constructor( customDueDate().ifPresent { it.validate() } invoiceDate().ifPresent { it.validate() } itemId() + markAsPaid() memo() netTerms() requireSuccessfulPayment() @@ -2256,6 +2298,7 @@ private constructor( (customDueDate.asKnown().getOrNull()?.validity() ?: 0) + (invoiceDate.asKnown().getOrNull()?.validity() ?: 0) + (if (itemId.asKnown().isPresent) 1 else 0) + + (if (markAsPaid.asKnown().isPresent) 1 else 0) + (if (memo.asKnown().isPresent) 1 else 0) + (if (netTerms.asKnown().isPresent) 1 else 0) + (if (requireSuccessfulPayment.asKnown().isPresent) 1 else 0) @@ -2631,6 +2674,7 @@ private constructor( customDueDate == other.customDueDate && invoiceDate == other.invoiceDate && itemId == other.itemId && + markAsPaid == other.markAsPaid && memo == other.memo && netTerms == other.netTerms && requireSuccessfulPayment == other.requireSuccessfulPayment && @@ -2643,6 +2687,7 @@ private constructor( customDueDate, invoiceDate, itemId, + markAsPaid, memo, netTerms, requireSuccessfulPayment, @@ -2653,7 +2698,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InvoiceSettings{autoCollection=$autoCollection, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, memo=$memo, netTerms=$netTerms, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}" + "InvoiceSettings{autoCollection=$autoCollection, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, markAsPaid=$markAsPaid, memo=$memo, netTerms=$netTerms, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}" } /** 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 9b94f9852..cdd91f53f 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 @@ -78,7 +78,8 @@ import kotlin.jvm.optionals.getOrNull * pass `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for * the customer for the credits pre-purchase. Note that you _must_ provide the * `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the - * cost basis with the number of credit units added. + * cost basis with the number of credit units added. Additionally, Orb also enforces invoice + * generation when a non-zero `per_unit_cost_basis` value is provided. * * ## Deducting Credits * Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb @@ -1778,6 +1779,7 @@ private constructor( private val customDueDate: JsonField, private val invoiceDate: JsonField, private val itemId: JsonField, + private val markAsPaid: JsonField, private val memo: JsonField, private val netTerms: JsonField, private val requireSuccessfulPayment: JsonField, @@ -1798,6 +1800,9 @@ private constructor( @JsonProperty("item_id") @ExcludeMissing itemId: JsonField = JsonMissing.of(), + @JsonProperty("mark_as_paid") + @ExcludeMissing + markAsPaid: JsonField = JsonMissing.of(), @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(), @@ -1812,6 +1817,7 @@ private constructor( customDueDate, invoiceDate, itemId, + markAsPaid, memo, netTerms, requireSuccessfulPayment, @@ -1857,6 +1863,14 @@ private constructor( */ fun itemId(): Optional = itemId.getOptional("item_id") + /** + * If true, the new credits purchase invoice will be marked as paid. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun markAsPaid(): Optional = markAsPaid.getOptional("mark_as_paid") + /** * An optional memo to display on the invoice. * @@ -1925,6 +1939,16 @@ private constructor( */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + /** + * Returns the raw JSON value of [markAsPaid]. + * + * Unlike [markAsPaid], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("mark_as_paid") + @ExcludeMissing + fun _markAsPaid(): JsonField = markAsPaid + /** * Returns the raw JSON value of [memo]. * @@ -1985,6 +2009,7 @@ private constructor( private var customDueDate: JsonField = JsonMissing.of() private var invoiceDate: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() + private var markAsPaid: JsonField = JsonMissing.of() private var memo: JsonField = JsonMissing.of() private var netTerms: JsonField = JsonMissing.of() private var requireSuccessfulPayment: JsonField = JsonMissing.of() @@ -1996,6 +2021,7 @@ private constructor( customDueDate = invoiceSettings.customDueDate invoiceDate = invoiceSettings.invoiceDate itemId = invoiceSettings.itemId + markAsPaid = invoiceSettings.markAsPaid memo = invoiceSettings.memo netTerms = invoiceSettings.netTerms requireSuccessfulPayment = invoiceSettings.requireSuccessfulPayment @@ -2101,6 +2127,20 @@ private constructor( */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + /** If true, the new credits purchase invoice will be marked as paid. */ + fun markAsPaid(markAsPaid: Boolean) = markAsPaid(JsonField.of(markAsPaid)) + + /** + * Sets [Builder.markAsPaid] to an arbitrary JSON value. + * + * You should usually call [Builder.markAsPaid] with a well-typed [Boolean] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun markAsPaid(markAsPaid: JsonField) = apply { + this.markAsPaid = markAsPaid + } + /** An optional memo to display on the invoice. */ fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) @@ -2204,6 +2244,7 @@ private constructor( customDueDate, invoiceDate, itemId, + markAsPaid, memo, netTerms, requireSuccessfulPayment, @@ -2222,6 +2263,7 @@ private constructor( customDueDate().ifPresent { it.validate() } invoiceDate().ifPresent { it.validate() } itemId() + markAsPaid() memo() netTerms() requireSuccessfulPayment() @@ -2248,6 +2290,7 @@ private constructor( (customDueDate.asKnown().getOrNull()?.validity() ?: 0) + (invoiceDate.asKnown().getOrNull()?.validity() ?: 0) + (if (itemId.asKnown().isPresent) 1 else 0) + + (if (markAsPaid.asKnown().isPresent) 1 else 0) + (if (memo.asKnown().isPresent) 1 else 0) + (if (netTerms.asKnown().isPresent) 1 else 0) + (if (requireSuccessfulPayment.asKnown().isPresent) 1 else 0) @@ -2623,6 +2666,7 @@ private constructor( customDueDate == other.customDueDate && invoiceDate == other.invoiceDate && itemId == other.itemId && + markAsPaid == other.markAsPaid && memo == other.memo && netTerms == other.netTerms && requireSuccessfulPayment == other.requireSuccessfulPayment && @@ -2635,6 +2679,7 @@ private constructor( customDueDate, invoiceDate, itemId, + markAsPaid, memo, netTerms, requireSuccessfulPayment, @@ -2645,7 +2690,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InvoiceSettings{autoCollection=$autoCollection, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, memo=$memo, netTerms=$netTerms, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}" + "InvoiceSettings{autoCollection=$autoCollection, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, markAsPaid=$markAsPaid, memo=$memo, netTerms=$netTerms, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}" } /** 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 f60e9739a..ffcbecf5d 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 @@ -38,10 +38,8 @@ import kotlin.jvm.optionals.getOrNull * * As usage for a customer is reported into Orb, credits may be deducted according to the customer's * plan configuration. An automated deduction of this type will result in a ledger entry, also with - * a starting and ending balance. In order to provide better tracing capabilities for automatic - * deductions, Orb always associates each automatic deduction with the `event_id` at the time of - * ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are - * never deducted without an associated usage event. + * a starting and ending balance. Each day's usage for a particular price, invoice, and block will + * be grouped into a single entry. * * By default, Orb uses an algorithm that automatically deducts from the *soonest expiring credit * block* first in order to ensure that all credits are utilized appropriately. As an example, if 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 b6a021be9..b3cf8fcaf 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 @@ -38,10 +38,8 @@ import kotlin.jvm.optionals.getOrNull * * As usage for a customer is reported into Orb, credits may be deducted according to the customer's * plan configuration. An automated deduction of this type will result in a ledger entry, also with - * a starting and ending balance. In order to provide better tracing capabilities for automatic - * deductions, Orb always associates each automatic deduction with the `event_id` at the time of - * ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are - * never deducted without an associated usage event. + * a starting and ending balance. Each day's usage for a particular price, invoice, and block will + * be grouped into a single entry. * * By default, Orb uses an algorithm that automatically deducts from the *soonest expiring credit * block* first in order to ensure that all credits are utilized appropriately. As an example, if 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 a4a0cf202..bb5177829 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 @@ -5,6 +5,8 @@ package com.withorb.api.models import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -17,12 +19,21 @@ import kotlin.jvm.optionals.getOrNull * * Note that `currency` defaults to credits if not specified. To use a real world currency, set * `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the `effective_date[gte]`, + * `effective_date[gt]`, `effective_date[lt]`, and `effective_date[lte]` query parameters. This + * filters on when the credit block becomes effective, which may differ from creation time for + * backdated credits. */ class CustomerCreditListByExternalIdParams private constructor( private val externalCustomerId: String?, private val currency: String?, private val cursor: String?, + private val effectiveDateGt: OffsetDateTime?, + private val effectiveDateGte: OffsetDateTime?, + private val effectiveDateLt: OffsetDateTime?, + private val effectiveDateLte: OffsetDateTime?, private val includeAllBlocks: Boolean?, private val limit: Long?, private val additionalHeaders: Headers, @@ -40,6 +51,14 @@ private constructor( */ fun cursor(): Optional = Optional.ofNullable(cursor) + fun effectiveDateGt(): Optional = Optional.ofNullable(effectiveDateGt) + + fun effectiveDateGte(): Optional = Optional.ofNullable(effectiveDateGte) + + fun effectiveDateLt(): Optional = Optional.ofNullable(effectiveDateLt) + + fun effectiveDateLte(): Optional = Optional.ofNullable(effectiveDateLte) + /** * If set to True, all expired and depleted blocks, as well as active block will be returned. */ @@ -73,6 +92,10 @@ private constructor( private var externalCustomerId: String? = null private var currency: String? = null private var cursor: String? = null + private var effectiveDateGt: OffsetDateTime? = null + private var effectiveDateGte: OffsetDateTime? = null + private var effectiveDateLt: OffsetDateTime? = null + private var effectiveDateLte: OffsetDateTime? = null private var includeAllBlocks: Boolean? = null private var limit: Long? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -85,6 +108,10 @@ private constructor( externalCustomerId = customerCreditListByExternalIdParams.externalCustomerId currency = customerCreditListByExternalIdParams.currency cursor = customerCreditListByExternalIdParams.cursor + effectiveDateGt = customerCreditListByExternalIdParams.effectiveDateGt + effectiveDateGte = customerCreditListByExternalIdParams.effectiveDateGte + effectiveDateLt = customerCreditListByExternalIdParams.effectiveDateLt + effectiveDateLte = customerCreditListByExternalIdParams.effectiveDateLte includeAllBlocks = customerCreditListByExternalIdParams.includeAllBlocks limit = customerCreditListByExternalIdParams.limit additionalHeaders = customerCreditListByExternalIdParams.additionalHeaders.toBuilder() @@ -117,6 +144,38 @@ private constructor( /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + fun effectiveDateGt(effectiveDateGt: OffsetDateTime?) = apply { + this.effectiveDateGt = effectiveDateGt + } + + /** Alias for calling [Builder.effectiveDateGt] with `effectiveDateGt.orElse(null)`. */ + fun effectiveDateGt(effectiveDateGt: Optional) = + effectiveDateGt(effectiveDateGt.getOrNull()) + + fun effectiveDateGte(effectiveDateGte: OffsetDateTime?) = apply { + this.effectiveDateGte = effectiveDateGte + } + + /** Alias for calling [Builder.effectiveDateGte] with `effectiveDateGte.orElse(null)`. */ + fun effectiveDateGte(effectiveDateGte: Optional) = + effectiveDateGte(effectiveDateGte.getOrNull()) + + fun effectiveDateLt(effectiveDateLt: OffsetDateTime?) = apply { + this.effectiveDateLt = effectiveDateLt + } + + /** Alias for calling [Builder.effectiveDateLt] with `effectiveDateLt.orElse(null)`. */ + fun effectiveDateLt(effectiveDateLt: Optional) = + effectiveDateLt(effectiveDateLt.getOrNull()) + + fun effectiveDateLte(effectiveDateLte: OffsetDateTime?) = apply { + this.effectiveDateLte = effectiveDateLte + } + + /** Alias for calling [Builder.effectiveDateLte] with `effectiveDateLte.orElse(null)`. */ + fun effectiveDateLte(effectiveDateLte: Optional) = + effectiveDateLte(effectiveDateLte.getOrNull()) + /** * If set to True, all expired and depleted blocks, as well as active block will be * returned. @@ -258,6 +317,10 @@ private constructor( externalCustomerId, currency, cursor, + effectiveDateGt, + effectiveDateGte, + effectiveDateLt, + effectiveDateLte, includeAllBlocks, limit, additionalHeaders.build(), @@ -278,6 +341,18 @@ private constructor( .apply { currency?.let { put("currency", it) } cursor?.let { put("cursor", it) } + effectiveDateGt?.let { + put("effective_date[gt]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + effectiveDateGte?.let { + put("effective_date[gte]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + effectiveDateLt?.let { + put("effective_date[lt]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + effectiveDateLte?.let { + put("effective_date[lte]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } includeAllBlocks?.let { put("include_all_blocks", it.toString()) } limit?.let { put("limit", it.toString()) } putAll(additionalQueryParams) @@ -293,6 +368,10 @@ private constructor( externalCustomerId == other.externalCustomerId && currency == other.currency && cursor == other.cursor && + effectiveDateGt == other.effectiveDateGt && + effectiveDateGte == other.effectiveDateGte && + effectiveDateLt == other.effectiveDateLt && + effectiveDateLte == other.effectiveDateLte && includeAllBlocks == other.includeAllBlocks && limit == other.limit && additionalHeaders == other.additionalHeaders && @@ -304,6 +383,10 @@ private constructor( externalCustomerId, currency, cursor, + effectiveDateGt, + effectiveDateGte, + effectiveDateLt, + effectiveDateLte, includeAllBlocks, limit, additionalHeaders, @@ -311,5 +394,5 @@ private constructor( ) override fun toString() = - "CustomerCreditListByExternalIdParams{externalCustomerId=$externalCustomerId, currency=$currency, cursor=$cursor, includeAllBlocks=$includeAllBlocks, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "CustomerCreditListByExternalIdParams{externalCustomerId=$externalCustomerId, currency=$currency, cursor=$cursor, effectiveDateGt=$effectiveDateGt, effectiveDateGte=$effectiveDateGte, effectiveDateLt=$effectiveDateLt, effectiveDateLte=$effectiveDateLte, includeAllBlocks=$includeAllBlocks, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } 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 f1e619c12..5f84ae0e0 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 @@ -30,6 +30,7 @@ private constructor( private val expiryDate: JsonField, private val filters: JsonField>, private val maximumInitialBalance: JsonField, + private val metadata: JsonField, private val perUnitCostBasis: JsonField, private val status: JsonField, private val additionalProperties: MutableMap, @@ -51,6 +52,7 @@ private constructor( @JsonProperty("maximum_initial_balance") @ExcludeMissing maximumInitialBalance: JsonField = JsonMissing.of(), + @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("per_unit_cost_basis") @ExcludeMissing perUnitCostBasis: JsonField = JsonMissing.of(), @@ -62,6 +64,7 @@ private constructor( expiryDate, filters, maximumInitialBalance, + metadata, perUnitCostBasis, status, mutableMapOf(), @@ -104,6 +107,16 @@ private constructor( fun maximumInitialBalance(): Optional = maximumInitialBalance.getOptional("maximum_initial_balance") + /** + * 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`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): Metadata = metadata.getRequired("metadata") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server * responded with an unexpected value). @@ -165,6 +178,13 @@ private constructor( @ExcludeMissing fun _maximumInitialBalance(): JsonField = maximumInitialBalance + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + /** * Returns the raw JSON value of [perUnitCostBasis]. * @@ -208,6 +228,7 @@ private constructor( * .expiryDate() * .filters() * .maximumInitialBalance() + * .metadata() * .perUnitCostBasis() * .status() * ``` @@ -224,6 +245,7 @@ private constructor( private var expiryDate: JsonField? = null private var filters: JsonField>? = null private var maximumInitialBalance: JsonField? = null + private var metadata: JsonField? = null private var perUnitCostBasis: JsonField? = null private var status: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -238,6 +260,7 @@ private constructor( expiryDate = customerCreditListByExternalIdResponse.expiryDate filters = customerCreditListByExternalIdResponse.filters.map { it.toMutableList() } maximumInitialBalance = customerCreditListByExternalIdResponse.maximumInitialBalance + metadata = customerCreditListByExternalIdResponse.metadata perUnitCostBasis = customerCreditListByExternalIdResponse.perUnitCostBasis status = customerCreditListByExternalIdResponse.status additionalProperties = @@ -352,6 +375,22 @@ private constructor( this.maximumInitialBalance = maximumInitialBalance } + /** + * 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)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + fun perUnitCostBasis(perUnitCostBasis: String?) = perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) @@ -412,6 +451,7 @@ private constructor( * .expiryDate() * .filters() * .maximumInitialBalance() + * .metadata() * .perUnitCostBasis() * .status() * ``` @@ -426,6 +466,7 @@ private constructor( checkRequired("expiryDate", expiryDate), checkRequired("filters", filters).map { it.toImmutable() }, checkRequired("maximumInitialBalance", maximumInitialBalance), + checkRequired("metadata", metadata), checkRequired("perUnitCostBasis", perUnitCostBasis), checkRequired("status", status), additionalProperties.toMutableMap(), @@ -445,6 +486,7 @@ private constructor( expiryDate() filters().forEach { it.validate() } maximumInitialBalance() + metadata().validate() perUnitCostBasis() status().validate() validated = true @@ -471,6 +513,7 @@ private constructor( (if (expiryDate.asKnown().isPresent) 1 else 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (maximumInitialBalance.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (perUnitCostBasis.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) @@ -981,6 +1024,110 @@ private constructor( "Filter{field=$field, operator=$operator, values=$values, 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`. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @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) + } + + /** + * Returns an immutable instance of [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -1117,6 +1264,7 @@ private constructor( expiryDate == other.expiryDate && filters == other.filters && maximumInitialBalance == other.maximumInitialBalance && + metadata == other.metadata && perUnitCostBasis == other.perUnitCostBasis && status == other.status && additionalProperties == other.additionalProperties @@ -1130,6 +1278,7 @@ private constructor( expiryDate, filters, maximumInitialBalance, + metadata, perUnitCostBasis, status, additionalProperties, @@ -1139,5 +1288,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CustomerCreditListByExternalIdResponse{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" + "CustomerCreditListByExternalIdResponse{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, metadata=$metadata, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" } 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 1819ee0c9..06a399edf 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 @@ -5,6 +5,8 @@ package com.withorb.api.models import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -17,12 +19,21 @@ import kotlin.jvm.optionals.getOrNull * * Note that `currency` defaults to credits if not specified. To use a real world currency, set * `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the `effective_date[gte]`, + * `effective_date[gt]`, `effective_date[lt]`, and `effective_date[lte]` query parameters. This + * filters on when the credit block becomes effective, which may differ from creation time for + * backdated credits. */ class CustomerCreditListParams private constructor( private val customerId: String?, private val currency: String?, private val cursor: String?, + private val effectiveDateGt: OffsetDateTime?, + private val effectiveDateGte: OffsetDateTime?, + private val effectiveDateLt: OffsetDateTime?, + private val effectiveDateLte: OffsetDateTime?, private val includeAllBlocks: Boolean?, private val limit: Long?, private val additionalHeaders: Headers, @@ -40,6 +51,14 @@ private constructor( */ fun cursor(): Optional = Optional.ofNullable(cursor) + fun effectiveDateGt(): Optional = Optional.ofNullable(effectiveDateGt) + + fun effectiveDateGte(): Optional = Optional.ofNullable(effectiveDateGte) + + fun effectiveDateLt(): Optional = Optional.ofNullable(effectiveDateLt) + + fun effectiveDateLte(): Optional = Optional.ofNullable(effectiveDateLte) + /** * If set to True, all expired and depleted blocks, as well as active block will be returned. */ @@ -70,6 +89,10 @@ private constructor( private var customerId: String? = null private var currency: String? = null private var cursor: String? = null + private var effectiveDateGt: OffsetDateTime? = null + private var effectiveDateGte: OffsetDateTime? = null + private var effectiveDateLt: OffsetDateTime? = null + private var effectiveDateLte: OffsetDateTime? = null private var includeAllBlocks: Boolean? = null private var limit: Long? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -80,6 +103,10 @@ private constructor( customerId = customerCreditListParams.customerId currency = customerCreditListParams.currency cursor = customerCreditListParams.cursor + effectiveDateGt = customerCreditListParams.effectiveDateGt + effectiveDateGte = customerCreditListParams.effectiveDateGte + effectiveDateLt = customerCreditListParams.effectiveDateLt + effectiveDateLte = customerCreditListParams.effectiveDateLte includeAllBlocks = customerCreditListParams.includeAllBlocks limit = customerCreditListParams.limit additionalHeaders = customerCreditListParams.additionalHeaders.toBuilder() @@ -106,6 +133,38 @@ private constructor( /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + fun effectiveDateGt(effectiveDateGt: OffsetDateTime?) = apply { + this.effectiveDateGt = effectiveDateGt + } + + /** Alias for calling [Builder.effectiveDateGt] with `effectiveDateGt.orElse(null)`. */ + fun effectiveDateGt(effectiveDateGt: Optional) = + effectiveDateGt(effectiveDateGt.getOrNull()) + + fun effectiveDateGte(effectiveDateGte: OffsetDateTime?) = apply { + this.effectiveDateGte = effectiveDateGte + } + + /** Alias for calling [Builder.effectiveDateGte] with `effectiveDateGte.orElse(null)`. */ + fun effectiveDateGte(effectiveDateGte: Optional) = + effectiveDateGte(effectiveDateGte.getOrNull()) + + fun effectiveDateLt(effectiveDateLt: OffsetDateTime?) = apply { + this.effectiveDateLt = effectiveDateLt + } + + /** Alias for calling [Builder.effectiveDateLt] with `effectiveDateLt.orElse(null)`. */ + fun effectiveDateLt(effectiveDateLt: Optional) = + effectiveDateLt(effectiveDateLt.getOrNull()) + + fun effectiveDateLte(effectiveDateLte: OffsetDateTime?) = apply { + this.effectiveDateLte = effectiveDateLte + } + + /** Alias for calling [Builder.effectiveDateLte] with `effectiveDateLte.orElse(null)`. */ + fun effectiveDateLte(effectiveDateLte: Optional) = + effectiveDateLte(effectiveDateLte.getOrNull()) + /** * If set to True, all expired and depleted blocks, as well as active block will be * returned. @@ -247,6 +306,10 @@ private constructor( customerId, currency, cursor, + effectiveDateGt, + effectiveDateGte, + effectiveDateLt, + effectiveDateLte, includeAllBlocks, limit, additionalHeaders.build(), @@ -267,6 +330,18 @@ private constructor( .apply { currency?.let { put("currency", it) } cursor?.let { put("cursor", it) } + effectiveDateGt?.let { + put("effective_date[gt]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + effectiveDateGte?.let { + put("effective_date[gte]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + effectiveDateLt?.let { + put("effective_date[lt]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + effectiveDateLte?.let { + put("effective_date[lte]", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } includeAllBlocks?.let { put("include_all_blocks", it.toString()) } limit?.let { put("limit", it.toString()) } putAll(additionalQueryParams) @@ -282,6 +357,10 @@ private constructor( customerId == other.customerId && currency == other.currency && cursor == other.cursor && + effectiveDateGt == other.effectiveDateGt && + effectiveDateGte == other.effectiveDateGte && + effectiveDateLt == other.effectiveDateLt && + effectiveDateLte == other.effectiveDateLte && includeAllBlocks == other.includeAllBlocks && limit == other.limit && additionalHeaders == other.additionalHeaders && @@ -293,6 +372,10 @@ private constructor( customerId, currency, cursor, + effectiveDateGt, + effectiveDateGte, + effectiveDateLt, + effectiveDateLte, includeAllBlocks, limit, additionalHeaders, @@ -300,5 +383,5 @@ private constructor( ) override fun toString() = - "CustomerCreditListParams{customerId=$customerId, currency=$currency, cursor=$cursor, includeAllBlocks=$includeAllBlocks, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "CustomerCreditListParams{customerId=$customerId, currency=$currency, cursor=$cursor, effectiveDateGt=$effectiveDateGt, effectiveDateGte=$effectiveDateGte, effectiveDateLt=$effectiveDateLt, effectiveDateLte=$effectiveDateLte, includeAllBlocks=$includeAllBlocks, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } 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 516d91b45..a719d324b 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 @@ -30,6 +30,7 @@ private constructor( private val expiryDate: JsonField, private val filters: JsonField>, private val maximumInitialBalance: JsonField, + private val metadata: JsonField, private val perUnitCostBasis: JsonField, private val status: JsonField, private val additionalProperties: MutableMap, @@ -51,6 +52,7 @@ private constructor( @JsonProperty("maximum_initial_balance") @ExcludeMissing maximumInitialBalance: JsonField = JsonMissing.of(), + @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("per_unit_cost_basis") @ExcludeMissing perUnitCostBasis: JsonField = JsonMissing.of(), @@ -62,6 +64,7 @@ private constructor( expiryDate, filters, maximumInitialBalance, + metadata, perUnitCostBasis, status, mutableMapOf(), @@ -104,6 +107,16 @@ private constructor( fun maximumInitialBalance(): Optional = maximumInitialBalance.getOptional("maximum_initial_balance") + /** + * 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`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): Metadata = metadata.getRequired("metadata") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server * responded with an unexpected value). @@ -165,6 +178,13 @@ private constructor( @ExcludeMissing fun _maximumInitialBalance(): JsonField = maximumInitialBalance + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + /** * Returns the raw JSON value of [perUnitCostBasis]. * @@ -207,6 +227,7 @@ private constructor( * .expiryDate() * .filters() * .maximumInitialBalance() + * .metadata() * .perUnitCostBasis() * .status() * ``` @@ -223,6 +244,7 @@ private constructor( private var expiryDate: JsonField? = null private var filters: JsonField>? = null private var maximumInitialBalance: JsonField? = null + private var metadata: JsonField? = null private var perUnitCostBasis: JsonField? = null private var status: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -235,6 +257,7 @@ private constructor( expiryDate = customerCreditListResponse.expiryDate filters = customerCreditListResponse.filters.map { it.toMutableList() } maximumInitialBalance = customerCreditListResponse.maximumInitialBalance + metadata = customerCreditListResponse.metadata perUnitCostBasis = customerCreditListResponse.perUnitCostBasis status = customerCreditListResponse.status additionalProperties = customerCreditListResponse.additionalProperties.toMutableMap() @@ -348,6 +371,22 @@ private constructor( this.maximumInitialBalance = maximumInitialBalance } + /** + * 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)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + fun perUnitCostBasis(perUnitCostBasis: String?) = perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) @@ -408,6 +447,7 @@ private constructor( * .expiryDate() * .filters() * .maximumInitialBalance() + * .metadata() * .perUnitCostBasis() * .status() * ``` @@ -422,6 +462,7 @@ private constructor( checkRequired("expiryDate", expiryDate), checkRequired("filters", filters).map { it.toImmutable() }, checkRequired("maximumInitialBalance", maximumInitialBalance), + checkRequired("metadata", metadata), checkRequired("perUnitCostBasis", perUnitCostBasis), checkRequired("status", status), additionalProperties.toMutableMap(), @@ -441,6 +482,7 @@ private constructor( expiryDate() filters().forEach { it.validate() } maximumInitialBalance() + metadata().validate() perUnitCostBasis() status().validate() validated = true @@ -467,6 +509,7 @@ private constructor( (if (expiryDate.asKnown().isPresent) 1 else 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (maximumInitialBalance.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (perUnitCostBasis.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) @@ -977,6 +1020,110 @@ private constructor( "Filter{field=$field, operator=$operator, values=$values, 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`. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @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) + } + + /** + * Returns an immutable instance of [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -1113,6 +1260,7 @@ private constructor( expiryDate == other.expiryDate && filters == other.filters && maximumInitialBalance == other.maximumInitialBalance && + metadata == other.metadata && perUnitCostBasis == other.perUnitCostBasis && status == other.status && additionalProperties == other.additionalProperties @@ -1126,6 +1274,7 @@ private constructor( expiryDate, filters, maximumInitialBalance, + metadata, perUnitCostBasis, status, additionalProperties, @@ -1135,5 +1284,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CustomerCreditListResponse{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" + "CustomerCreditListResponse{id=$id, balance=$balance, effectiveDate=$effectiveDate, expiryDate=$expiryDate, filters=$filters, maximumInitialBalance=$maximumInitialBalance, metadata=$metadata, perUnitCostBasis=$perUnitCostBasis, status=$status, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerTaxId.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerTaxId.kt index 09bcbb95c..fd2504cf5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerTaxId.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerTaxId.kt @@ -123,6 +123,7 @@ import kotlin.jvm.optionals.getOrNull * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1328,6 +1329,8 @@ private constructor( @JvmField val PH_TIN = of("ph_tin") + @JvmField val PL_NIP = of("pl_nip") + @JvmField val RO_TIN = of("ro_tin") @JvmField val RS_PIB = of("rs_pib") @@ -1470,6 +1473,7 @@ private constructor( OM_VAT, PE_RUC, PH_TIN, + PL_NIP, RO_TIN, RS_PIB, RU_INN, @@ -1592,6 +1596,7 @@ private constructor( OM_VAT, PE_RUC, PH_TIN, + PL_NIP, RO_TIN, RS_PIB, RU_INN, @@ -1715,6 +1720,7 @@ private constructor( OM_VAT -> Value.OM_VAT PE_RUC -> Value.PE_RUC PH_TIN -> Value.PH_TIN + PL_NIP -> Value.PL_NIP RO_TIN -> Value.RO_TIN RS_PIB -> Value.RS_PIB RU_INN -> Value.RU_INN @@ -1838,6 +1844,7 @@ private constructor( OM_VAT -> Known.OM_VAT PE_RUC -> Known.PE_RUC PH_TIN -> Known.PH_TIN + PL_NIP -> Known.PL_NIP RO_TIN -> Known.RO_TIN RS_PIB -> Known.RS_PIB RU_INN -> Known.RU_INN 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 dec9f8ada..3949814b8 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 @@ -307,6 +307,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1162,6 +1163,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1728,6 +1730,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -2642,6 +2645,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | 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 971b2f8ad..218ffa321 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 @@ -308,6 +308,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1158,6 +1159,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1724,6 +1726,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -2638,6 +2641,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | 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 c1f6102c2..75786b486 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 @@ -403,6 +403,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -450,6 +451,11 @@ private constructor( /** * This field is deprecated in favor of `discounts`. If a `discounts` list is provided, the * first discount in the list will be returned. If the list is empty, `None` will be returned. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = invoice.discount().convert(MyClass.class); + * ``` */ @Deprecated("deprecated") @JsonProperty("discount") @@ -1446,6 +1452,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | 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 c57bd6e61..80db7641e 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 @@ -396,6 +396,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -443,6 +444,11 @@ private constructor( /** * This field is deprecated in favor of `discounts`. If a `discounts` list is provided, the * first discount in the list will be returned. If the list is empty, `None` will be returned. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = invoiceFetchUpcomingResponse.discount().convert(MyClass.class); + * ``` */ @Deprecated("deprecated") @JsonProperty("discount") @@ -1440,6 +1446,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueSummaryParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueSummaryParams.kt new file mode 100644 index 000000000..afb1253db --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueSummaryParams.kt @@ -0,0 +1,443 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +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 +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * This endpoint allows an eligible invoice to be issued manually. This is only possible with + * invoices where status is `draft`, `will_auto_issue` is false, and an `eligible_to_issue_at` is a + * time in the past. Issuing an invoice could possibly trigger side effects, some of which could be + * customer-visible (e.g. sending emails, auto-collecting payment, syncing the invoice to external + * providers, etc). + * + * This is a lighter-weight alternative to the issue invoice endpoint, returning an invoice summary + * without any line item details. + */ +class InvoiceIssueSummaryParams +private constructor( + private val invoiceId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun invoiceId(): Optional = Optional.ofNullable(invoiceId) + + /** + * If true, the invoice will be issued synchronously. If false, the invoice will be issued + * asynchronously. The synchronous option is only available for invoices that have no usage + * fees. If the invoice is configured to sync to an external provider, a successful response + * from this endpoint guarantees the invoice is present in the provider. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun synchronous(): Optional = body.synchronous() + + /** + * Returns the raw JSON value of [synchronous]. + * + * Unlike [synchronous], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _synchronous(): JsonField = body._synchronous() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): InvoiceIssueSummaryParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [InvoiceIssueSummaryParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InvoiceIssueSummaryParams]. */ + class Builder internal constructor() { + + private var invoiceId: String? = null + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(invoiceIssueSummaryParams: InvoiceIssueSummaryParams) = apply { + invoiceId = invoiceIssueSummaryParams.invoiceId + body = invoiceIssueSummaryParams.body.toBuilder() + additionalHeaders = invoiceIssueSummaryParams.additionalHeaders.toBuilder() + additionalQueryParams = invoiceIssueSummaryParams.additionalQueryParams.toBuilder() + } + + fun invoiceId(invoiceId: String?) = apply { this.invoiceId = invoiceId } + + /** Alias for calling [Builder.invoiceId] with `invoiceId.orElse(null)`. */ + fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [synchronous] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * If true, the invoice will be issued synchronously. If false, the invoice will be issued + * asynchronously. The synchronous option is only available for invoices that have no usage + * fees. If the invoice is configured to sync to an external provider, a successful response + * from this endpoint guarantees the invoice is present in the provider. + */ + fun synchronous(synchronous: Boolean) = apply { body.synchronous(synchronous) } + + /** + * Sets [Builder.synchronous] to an arbitrary JSON value. + * + * You should usually call [Builder.synchronous] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun synchronous(synchronous: JsonField) = apply { body.synchronous(synchronous) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InvoiceIssueSummaryParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InvoiceIssueSummaryParams = + InvoiceIssueSummaryParams( + invoiceId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> invoiceId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val synchronous: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("synchronous") + @ExcludeMissing + synchronous: JsonField = JsonMissing.of() + ) : this(synchronous, mutableMapOf()) + + /** + * If true, the invoice will be issued synchronously. If false, the invoice will be issued + * asynchronously. The synchronous option is only available for invoices that have no usage + * fees. If the invoice is configured to sync to an external provider, a successful response + * from this endpoint guarantees the invoice is present in the provider. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun synchronous(): Optional = synchronous.getOptional("synchronous") + + /** + * Returns the raw JSON value of [synchronous]. + * + * Unlike [synchronous], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("synchronous") + @ExcludeMissing + fun _synchronous(): JsonField = synchronous + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var synchronous: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + synchronous = body.synchronous + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * If true, the invoice will be issued synchronously. If false, the invoice will be + * issued asynchronously. The synchronous option is only available for invoices that + * have no usage fees. If the invoice is configured to sync to an external provider, a + * successful response from this endpoint guarantees the invoice is present in the + * provider. + */ + fun synchronous(synchronous: Boolean) = synchronous(JsonField.of(synchronous)) + + /** + * Sets [Builder.synchronous] to an arbitrary JSON value. + * + * You should usually call [Builder.synchronous] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun synchronous(synchronous: JsonField) = apply { + this.synchronous = synchronous + } + + 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) + } + + /** + * Returns an immutable instance of [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = Body(synchronous, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + synchronous() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (if (synchronous.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + synchronous == other.synchronous && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(synchronous, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{synchronous=$synchronous, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InvoiceIssueSummaryParams && + invoiceId == other.invoiceId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(invoiceId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "InvoiceIssueSummaryParams{invoiceId=$invoiceId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueSummaryResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueSummaryResponse.kt new file mode 100644 index 000000000..8d14fcce3 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueSummaryResponse.kt @@ -0,0 +1,4593 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** #InvoiceApiResourceWithoutLineItems */ +class InvoiceIssueSummaryResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val amountDue: JsonField, + private val autoCollection: JsonField, + private val billingAddress: JsonField
, + private val createdAt: JsonField, + private val creditNotes: JsonField>, + private val currency: JsonField, + private val customer: JsonField, + private val customerBalanceTransactions: JsonField>, + private val customerTaxId: JsonField, + private val dueDate: JsonField, + private val eligibleToIssueAt: JsonField, + private val hostedInvoiceUrl: JsonField, + private val invoiceDate: JsonField, + private val invoiceNumber: JsonField, + private val invoicePdf: JsonField, + private val invoiceSource: JsonField, + private val issueFailedAt: JsonField, + private val issuedAt: JsonField, + private val memo: JsonField, + private val metadata: JsonField, + private val paidAt: JsonField, + private val paymentAttempts: JsonField>, + private val paymentFailedAt: JsonField, + private val paymentStartedAt: JsonField, + private val scheduledIssueAt: JsonField, + private val shippingAddress: JsonField
, + private val status: JsonField, + private val subscription: JsonField, + private val syncFailedAt: JsonField, + private val total: JsonField, + private val voidedAt: JsonField, + private val willAutoIssue: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("amount_due") @ExcludeMissing amountDue: JsonField = JsonMissing.of(), + @JsonProperty("auto_collection") + @ExcludeMissing + autoCollection: JsonField = JsonMissing.of(), + @JsonProperty("billing_address") + @ExcludeMissing + billingAddress: JsonField
= JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("credit_notes") + @ExcludeMissing + creditNotes: JsonField> = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("customer") + @ExcludeMissing + customer: JsonField = JsonMissing.of(), + @JsonProperty("customer_balance_transactions") + @ExcludeMissing + customerBalanceTransactions: JsonField> = JsonMissing.of(), + @JsonProperty("customer_tax_id") + @ExcludeMissing + customerTaxId: JsonField = JsonMissing.of(), + @JsonProperty("due_date") + @ExcludeMissing + dueDate: JsonField = JsonMissing.of(), + @JsonProperty("eligible_to_issue_at") + @ExcludeMissing + eligibleToIssueAt: JsonField = JsonMissing.of(), + @JsonProperty("hosted_invoice_url") + @ExcludeMissing + hostedInvoiceUrl: JsonField = JsonMissing.of(), + @JsonProperty("invoice_date") + @ExcludeMissing + invoiceDate: JsonField = JsonMissing.of(), + @JsonProperty("invoice_number") + @ExcludeMissing + invoiceNumber: JsonField = JsonMissing.of(), + @JsonProperty("invoice_pdf") + @ExcludeMissing + invoicePdf: JsonField = JsonMissing.of(), + @JsonProperty("invoice_source") + @ExcludeMissing + invoiceSource: JsonField = JsonMissing.of(), + @JsonProperty("issue_failed_at") + @ExcludeMissing + issueFailedAt: JsonField = JsonMissing.of(), + @JsonProperty("issued_at") + @ExcludeMissing + issuedAt: JsonField = JsonMissing.of(), + @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(), + @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), + @JsonProperty("paid_at") + @ExcludeMissing + paidAt: JsonField = JsonMissing.of(), + @JsonProperty("payment_attempts") + @ExcludeMissing + paymentAttempts: JsonField> = JsonMissing.of(), + @JsonProperty("payment_failed_at") + @ExcludeMissing + paymentFailedAt: JsonField = JsonMissing.of(), + @JsonProperty("payment_started_at") + @ExcludeMissing + paymentStartedAt: JsonField = JsonMissing.of(), + @JsonProperty("scheduled_issue_at") + @ExcludeMissing + scheduledIssueAt: JsonField = JsonMissing.of(), + @JsonProperty("shipping_address") + @ExcludeMissing + shippingAddress: JsonField
= JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription") + @ExcludeMissing + subscription: JsonField = JsonMissing.of(), + @JsonProperty("sync_failed_at") + @ExcludeMissing + syncFailedAt: JsonField = JsonMissing.of(), + @JsonProperty("total") @ExcludeMissing total: JsonField = JsonMissing.of(), + @JsonProperty("voided_at") + @ExcludeMissing + voidedAt: JsonField = JsonMissing.of(), + @JsonProperty("will_auto_issue") + @ExcludeMissing + willAutoIssue: JsonField = JsonMissing.of(), + ) : this( + id, + amountDue, + autoCollection, + billingAddress, + createdAt, + creditNotes, + currency, + customer, + customerBalanceTransactions, + customerTaxId, + dueDate, + eligibleToIssueAt, + hostedInvoiceUrl, + invoiceDate, + invoiceNumber, + invoicePdf, + invoiceSource, + issueFailedAt, + issuedAt, + memo, + metadata, + paidAt, + paymentAttempts, + paymentFailedAt, + paymentStartedAt, + scheduledIssueAt, + shippingAddress, + status, + subscription, + syncFailedAt, + total, + voidedAt, + willAutoIssue, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * This is the final amount required to be charged to the customer and reflects the application + * of the customer balance to the `total` of the invoice. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun amountDue(): String = amountDue.getRequired("amount_due") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun autoCollection(): AutoCollection = autoCollection.getRequired("auto_collection") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun billingAddress(): Optional
= billingAddress.getOptional("billing_address") + + /** + * The creation time of the resource in Orb. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * A list of credit notes associated with the invoice + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun creditNotes(): List = creditNotes.getRequired("credit_notes") + + /** + * An ISO 4217 currency string or `credits` + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun currency(): String = currency.getRequired("currency") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun customer(): CustomerMinified = customer.getRequired("customer") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun customerBalanceTransactions(): List = + customerBalanceTransactions.getRequired("customer_balance_transactions") + + /** + * Tax IDs are commonly required to be displayed on customer invoices, which are added to the + * headers of invoices. + * + * ### Supported Tax ID Countries and Types + * |Country |Type |Description | + * |----------------------|------------|-------------------------------------------------------------------------------------------------------| + * |Albania |`al_tin` |Albania Tax Identification Number | + * |Andorra |`ad_nrt` |Andorran NRT Number | + * |Angola |`ao_tin` |Angola Tax Identification Number | + * |Argentina |`ar_cuit` |Argentinian Tax ID Number | + * |Armenia |`am_tin` |Armenia Tax Identification Number | + * |Aruba |`aw_tin` |Aruba Tax Identification Number | + * |Australia |`au_abn` |Australian Business Number (AU ABN) | + * |Australia |`au_arn` |Australian Taxation Office Reference Number | + * |Austria |`eu_vat` |European VAT Number | + * |Azerbaijan |`az_tin` |Azerbaijan Tax Identification Number | + * |Bahamas |`bs_tin` |Bahamas Tax Identification Number | + * |Bahrain |`bh_vat` |Bahraini VAT Number | + * |Bangladesh |`bd_bin` |Bangladesh Business Identification Number | + * |Barbados |`bb_tin` |Barbados Tax Identification Number | + * |Belarus |`by_tin` |Belarus TIN Number | + * |Belgium |`eu_vat` |European VAT Number | + * |Benin |`bj_ifu` |Benin Tax Identification Number (Identifiant Fiscal Unique) | + * |Bolivia |`bo_tin` |Bolivian Tax ID | + * |Bosnia and Herzegovina|`ba_tin` |Bosnia and Herzegovina Tax Identification Number | + * |Brazil |`br_cnpj` |Brazilian CNPJ Number | + * |Brazil |`br_cpf` |Brazilian CPF Number | + * |Bulgaria |`bg_uic` |Bulgaria Unified Identification Code | + * |Bulgaria |`eu_vat` |European VAT Number | + * |Burkina Faso |`bf_ifu` |Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + * |Cambodia |`kh_tin` |Cambodia Tax Identification Number | + * |Cameroon |`cm_niu` |Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + * |Canada |`ca_bn` |Canadian BN | + * |Canada |`ca_gst_hst`|Canadian GST/HST Number | + * |Canada |`ca_pst_bc` |Canadian PST Number (British Columbia) | + * |Canada |`ca_pst_mb` |Canadian PST Number (Manitoba) | + * |Canada |`ca_pst_sk` |Canadian PST Number (Saskatchewan) | + * |Canada |`ca_qst` |Canadian QST Number (Québec) | + * |Cape Verde |`cv_nif` |Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + * |Chile |`cl_tin` |Chilean TIN | + * |China |`cn_tin` |Chinese Tax ID | + * |Colombia |`co_nit` |Colombian NIT Number | + * |Congo-Kinshasa |`cd_nif` |Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + * |Costa Rica |`cr_tin` |Costa Rican Tax ID | + * |Croatia |`eu_vat` |European VAT Number | + * |Croatia |`hr_oib` |Croatian Personal Identification Number (OIB) | + * |Cyprus |`eu_vat` |European VAT Number | + * |Czech Republic |`eu_vat` |European VAT Number | + * |Denmark |`eu_vat` |European VAT Number | + * |Dominican Republic |`do_rcn` |Dominican RCN Number | + * |Ecuador |`ec_ruc` |Ecuadorian RUC Number | + * |Egypt |`eg_tin` |Egyptian Tax Identification Number | + * |El Salvador |`sv_nit` |El Salvadorian NIT Number | + * |Estonia |`eu_vat` |European VAT Number | + * |Ethiopia |`et_tin` |Ethiopia Tax Identification Number | + * |European Union |`eu_oss_vat`|European One Stop Shop VAT Number for non-Union scheme | + * |Finland |`eu_vat` |European VAT Number | + * |France |`eu_vat` |European VAT Number | + * |Georgia |`ge_vat` |Georgian VAT | + * |Germany |`de_stn` |German Tax Number (Steuernummer) | + * |Germany |`eu_vat` |European VAT Number | + * |Greece |`eu_vat` |European VAT Number | + * |Guinea |`gn_nif` |Guinea Tax Identification Number (Número de Identificação Fiscal) | + * |Hong Kong |`hk_br` |Hong Kong BR Number | + * |Hungary |`eu_vat` |European VAT Number | + * |Hungary |`hu_tin` |Hungary Tax Number (adószám) | + * |Iceland |`is_vat` |Icelandic VAT | + * |India |`in_gst` |Indian GST Number | + * |Indonesia |`id_npwp` |Indonesian NPWP Number | + * |Ireland |`eu_vat` |European VAT Number | + * |Israel |`il_vat` |Israel VAT | + * |Italy |`eu_vat` |European VAT Number | + * |Japan |`jp_cn` |Japanese Corporate Number (*Hōjin Bangō*) | + * |Japan |`jp_rn` |Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*)| + * |Japan |`jp_trn` |Japanese Tax Registration Number (*Tōroku Bangō*) | + * |Kazakhstan |`kz_bin` |Kazakhstani Business Identification Number | + * |Kenya |`ke_pin` |Kenya Revenue Authority Personal Identification Number | + * |Kyrgyzstan |`kg_tin` |Kyrgyzstan Tax Identification Number | + * |Laos |`la_tin` |Laos Tax Identification Number | + * |Latvia |`eu_vat` |European VAT Number | + * |Liechtenstein |`li_uid` |Liechtensteinian UID Number | + * |Liechtenstein |`li_vat` |Liechtenstein VAT Number | + * |Lithuania |`eu_vat` |European VAT Number | + * |Luxembourg |`eu_vat` |European VAT Number | + * |Malaysia |`my_frp` |Malaysian FRP Number | + * |Malaysia |`my_itn` |Malaysian ITN | + * |Malaysia |`my_sst` |Malaysian SST Number | + * |Malta |`eu_vat` |European VAT Number | + * |Mauritania |`mr_nif` |Mauritania Tax Identification Number (Número de Identificação Fiscal) | + * |Mexico |`mx_rfc` |Mexican RFC Number | + * |Moldova |`md_vat` |Moldova VAT Number | + * |Montenegro |`me_pib` |Montenegro PIB Number | + * |Morocco |`ma_vat` |Morocco VAT Number | + * |Nepal |`np_pan` |Nepal PAN Number | + * |Netherlands |`eu_vat` |European VAT Number | + * |New Zealand |`nz_gst` |New Zealand GST Number | + * |Nigeria |`ng_tin` |Nigerian Tax Identification Number | + * |North Macedonia |`mk_vat` |North Macedonia VAT Number | + * |Northern Ireland |`eu_vat` |Northern Ireland VAT Number | + * |Norway |`no_vat` |Norwegian VAT Number | + * |Norway |`no_voec` |Norwegian VAT on e-commerce Number | + * |Oman |`om_vat` |Omani VAT Number | + * |Peru |`pe_ruc` |Peruvian RUC Number | + * |Philippines |`ph_tin` |Philippines Tax Identification Number | + * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | + * |Portugal |`eu_vat` |European VAT Number | + * |Romania |`eu_vat` |European VAT Number | + * |Romania |`ro_tin` |Romanian Tax ID Number | + * |Russia |`ru_inn` |Russian INN | + * |Russia |`ru_kpp` |Russian KPP | + * |Saudi Arabia |`sa_vat` |Saudi Arabia VAT | + * |Senegal |`sn_ninea` |Senegal NINEA Number | + * |Serbia |`rs_pib` |Serbian PIB Number | + * |Singapore |`sg_gst` |Singaporean GST | + * |Singapore |`sg_uen` |Singaporean UEN | + * |Slovakia |`eu_vat` |European VAT Number | + * |Slovenia |`eu_vat` |European VAT Number | + * |Slovenia |`si_tin` |Slovenia Tax Number (davčna številka) | + * |South Africa |`za_vat` |South African VAT Number | + * |South Korea |`kr_brn` |Korean BRN | + * |Spain |`es_cif` |Spanish NIF Number (previously Spanish CIF Number) | + * |Spain |`eu_vat` |European VAT Number | + * |Suriname |`sr_fin` |Suriname FIN Number | + * |Sweden |`eu_vat` |European VAT Number | + * |Switzerland |`ch_uid` |Switzerland UID Number | + * |Switzerland |`ch_vat` |Switzerland VAT Number | + * |Taiwan |`tw_vat` |Taiwanese VAT | + * |Tajikistan |`tj_tin` |Tajikistan Tax Identification Number | + * |Tanzania |`tz_vat` |Tanzania VAT Number | + * |Thailand |`th_vat` |Thai VAT | + * |Turkey |`tr_tin` |Turkish Tax Identification Number | + * |Uganda |`ug_tin` |Uganda Tax Identification Number | + * |Ukraine |`ua_vat` |Ukrainian VAT | + * |United Arab Emirates |`ae_trn` |United Arab Emirates TRN | + * |United Kingdom |`gb_vat` |United Kingdom VAT Number | + * |United States |`us_ein` |United States EIN | + * |Uruguay |`uy_ruc` |Uruguayan RUC Number | + * |Uzbekistan |`uz_tin` |Uzbekistan TIN Number | + * |Uzbekistan |`uz_vat` |Uzbekistan VAT Number | + * |Venezuela |`ve_rif` |Venezuelan RIF Number | + * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |Zambia |`zm_tin` |Zambia Tax Identification Number | + * |Zimbabwe |`zw_tin` |Zimbabwe Tax Identification Number | + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun customerTaxId(): Optional = customerTaxId.getOptional("customer_tax_id") + + /** + * When the invoice payment is due. The due date is null if the invoice is not yet finalized. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun dueDate(): Optional = dueDate.getOptional("due_date") + + /** + * If the invoice has a status of `draft`, this will be the time that the invoice will be + * eligible to be issued, otherwise it will be `null`. If `auto-issue` is true, the invoice will + * automatically begin issuing at this time. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun eligibleToIssueAt(): Optional = + eligibleToIssueAt.getOptional("eligible_to_issue_at") + + /** + * A URL for the customer-facing invoice portal. This URL expires 30 days after the invoice's + * due date, or 60 days after being re-generated through the UI. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun hostedInvoiceUrl(): Optional = hostedInvoiceUrl.getOptional("hosted_invoice_url") + + /** + * The scheduled date of the invoice + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun invoiceDate(): OffsetDateTime = invoiceDate.getRequired("invoice_date") + + /** + * Automatically generated invoice number to help track and reconcile invoices. Invoice numbers + * have a prefix such as `RFOBWG`. These can be sequential per account or customer. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun invoiceNumber(): String = invoiceNumber.getRequired("invoice_number") + + /** + * The link to download the PDF representation of the `Invoice`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun invoicePdf(): Optional = invoicePdf.getOptional("invoice_pdf") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun invoiceSource(): InvoiceSource = invoiceSource.getRequired("invoice_source") + + /** + * If the invoice failed to issue, this will be the last time it failed to issue (even if it is + * now in a different state.) + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun issueFailedAt(): Optional = issueFailedAt.getOptional("issue_failed_at") + + /** + * If the invoice has been issued, this will be the time it transitioned to `issued` (even if it + * is now in a different state.) + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun issuedAt(): Optional = issuedAt.getOptional("issued_at") + + /** + * Free-form text which is available on the invoice PDF and the Orb invoice portal. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun memo(): Optional = memo.getOptional("memo") + + /** + * 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`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): Metadata = metadata.getRequired("metadata") + + /** + * If the invoice has a status of `paid`, this gives a timestamp when the invoice was paid. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun paidAt(): Optional = paidAt.getOptional("paid_at") + + /** + * A list of payment attempts associated with the invoice + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun paymentAttempts(): List = paymentAttempts.getRequired("payment_attempts") + + /** + * If payment was attempted on this invoice but failed, this will be the time of the most recent + * attempt. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun paymentFailedAt(): Optional = + paymentFailedAt.getOptional("payment_failed_at") + + /** + * If payment was attempted on this invoice, this will be the start time of the most recent + * attempt. This field is especially useful for delayed-notification payment mechanisms (like + * bank transfers), where payment can take 3 days or more. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun paymentStartedAt(): Optional = + paymentStartedAt.getOptional("payment_started_at") + + /** + * If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to be + * issued. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun scheduledIssueAt(): Optional = + scheduledIssueAt.getOptional("scheduled_issue_at") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun shippingAddress(): Optional
= shippingAddress.getOptional("shipping_address") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun subscription(): Optional = subscription.getOptional("subscription") + + /** + * If the invoice failed to sync, this will be the last time an external invoicing provider sync + * was attempted. This field will always be `null` for invoices using Orb Invoicing. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun syncFailedAt(): Optional = syncFailedAt.getOptional("sync_failed_at") + + /** + * The total after any minimums and discounts have been applied. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun total(): String = total.getRequired("total") + + /** + * If the invoice has a status of `void`, this gives a timestamp when the invoice was voided. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun voidedAt(): Optional = voidedAt.getOptional("voided_at") + + /** + * This is true if the invoice will be automatically issued in the future, and false otherwise. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun willAutoIssue(): Boolean = willAutoIssue.getRequired("will_auto_issue") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [amountDue]. + * + * Unlike [amountDue], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount_due") @ExcludeMissing fun _amountDue(): JsonField = amountDue + + /** + * Returns the raw JSON value of [autoCollection]. + * + * Unlike [autoCollection], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("auto_collection") + @ExcludeMissing + fun _autoCollection(): JsonField = autoCollection + + /** + * Returns the raw JSON value of [billingAddress]. + * + * Unlike [billingAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("billing_address") + @ExcludeMissing + fun _billingAddress(): JsonField
= billingAddress + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [creditNotes]. + * + * Unlike [creditNotes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("credit_notes") + @ExcludeMissing + fun _creditNotes(): JsonField> = creditNotes + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [customer]. + * + * Unlike [customer], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("customer") + @ExcludeMissing + fun _customer(): JsonField = customer + + /** + * Returns the raw JSON value of [customerBalanceTransactions]. + * + * Unlike [customerBalanceTransactions], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("customer_balance_transactions") + @ExcludeMissing + fun _customerBalanceTransactions(): JsonField> = + customerBalanceTransactions + + /** + * Returns the raw JSON value of [customerTaxId]. + * + * Unlike [customerTaxId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("customer_tax_id") + @ExcludeMissing + fun _customerTaxId(): JsonField = customerTaxId + + /** + * Returns the raw JSON value of [dueDate]. + * + * Unlike [dueDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("due_date") @ExcludeMissing fun _dueDate(): JsonField = dueDate + + /** + * Returns the raw JSON value of [eligibleToIssueAt]. + * + * Unlike [eligibleToIssueAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("eligible_to_issue_at") + @ExcludeMissing + fun _eligibleToIssueAt(): JsonField = eligibleToIssueAt + + /** + * Returns the raw JSON value of [hostedInvoiceUrl]. + * + * Unlike [hostedInvoiceUrl], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("hosted_invoice_url") + @ExcludeMissing + fun _hostedInvoiceUrl(): JsonField = hostedInvoiceUrl + + /** + * Returns the raw JSON value of [invoiceDate]. + * + * Unlike [invoiceDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("invoice_date") + @ExcludeMissing + fun _invoiceDate(): JsonField = invoiceDate + + /** + * Returns the raw JSON value of [invoiceNumber]. + * + * Unlike [invoiceNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("invoice_number") + @ExcludeMissing + fun _invoiceNumber(): JsonField = invoiceNumber + + /** + * Returns the raw JSON value of [invoicePdf]. + * + * Unlike [invoicePdf], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("invoice_pdf") @ExcludeMissing fun _invoicePdf(): JsonField = invoicePdf + + /** + * Returns the raw JSON value of [invoiceSource]. + * + * Unlike [invoiceSource], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("invoice_source") + @ExcludeMissing + fun _invoiceSource(): JsonField = invoiceSource + + /** + * Returns the raw JSON value of [issueFailedAt]. + * + * Unlike [issueFailedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("issue_failed_at") + @ExcludeMissing + fun _issueFailedAt(): JsonField = issueFailedAt + + /** + * Returns the raw JSON value of [issuedAt]. + * + * Unlike [issuedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("issued_at") @ExcludeMissing fun _issuedAt(): JsonField = issuedAt + + /** + * Returns the raw JSON value of [memo]. + * + * Unlike [memo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("memo") @ExcludeMissing fun _memo(): JsonField = memo + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [paidAt]. + * + * Unlike [paidAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("paid_at") @ExcludeMissing fun _paidAt(): JsonField = paidAt + + /** + * Returns the raw JSON value of [paymentAttempts]. + * + * Unlike [paymentAttempts], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("payment_attempts") + @ExcludeMissing + fun _paymentAttempts(): JsonField> = paymentAttempts + + /** + * Returns the raw JSON value of [paymentFailedAt]. + * + * Unlike [paymentFailedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("payment_failed_at") + @ExcludeMissing + fun _paymentFailedAt(): JsonField = paymentFailedAt + + /** + * Returns the raw JSON value of [paymentStartedAt]. + * + * Unlike [paymentStartedAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("payment_started_at") + @ExcludeMissing + fun _paymentStartedAt(): JsonField = paymentStartedAt + + /** + * Returns the raw JSON value of [scheduledIssueAt]. + * + * Unlike [scheduledIssueAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("scheduled_issue_at") + @ExcludeMissing + fun _scheduledIssueAt(): JsonField = scheduledIssueAt + + /** + * Returns the raw JSON value of [shippingAddress]. + * + * Unlike [shippingAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("shipping_address") + @ExcludeMissing + fun _shippingAddress(): JsonField
= shippingAddress + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscription]. + * + * Unlike [subscription], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("subscription") + @ExcludeMissing + fun _subscription(): JsonField = subscription + + /** + * Returns the raw JSON value of [syncFailedAt]. + * + * Unlike [syncFailedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("sync_failed_at") + @ExcludeMissing + fun _syncFailedAt(): JsonField = syncFailedAt + + /** + * Returns the raw JSON value of [total]. + * + * Unlike [total], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("total") @ExcludeMissing fun _total(): JsonField = total + + /** + * Returns the raw JSON value of [voidedAt]. + * + * Unlike [voidedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("voided_at") @ExcludeMissing fun _voidedAt(): JsonField = voidedAt + + /** + * Returns the raw JSON value of [willAutoIssue]. + * + * Unlike [willAutoIssue], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("will_auto_issue") + @ExcludeMissing + fun _willAutoIssue(): JsonField = willAutoIssue + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InvoiceIssueSummaryResponse]. + * + * The following fields are required: + * ```java + * .id() + * .amountDue() + * .autoCollection() + * .billingAddress() + * .createdAt() + * .creditNotes() + * .currency() + * .customer() + * .customerBalanceTransactions() + * .customerTaxId() + * .dueDate() + * .eligibleToIssueAt() + * .hostedInvoiceUrl() + * .invoiceDate() + * .invoiceNumber() + * .invoicePdf() + * .invoiceSource() + * .issueFailedAt() + * .issuedAt() + * .memo() + * .metadata() + * .paidAt() + * .paymentAttempts() + * .paymentFailedAt() + * .paymentStartedAt() + * .scheduledIssueAt() + * .shippingAddress() + * .status() + * .subscription() + * .syncFailedAt() + * .total() + * .voidedAt() + * .willAutoIssue() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InvoiceIssueSummaryResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var amountDue: JsonField? = null + private var autoCollection: JsonField? = null + private var billingAddress: JsonField
? = null + private var createdAt: JsonField? = null + private var creditNotes: JsonField>? = null + private var currency: JsonField? = null + private var customer: JsonField? = null + private var customerBalanceTransactions: + JsonField>? = + null + private var customerTaxId: JsonField? = null + private var dueDate: JsonField? = null + private var eligibleToIssueAt: JsonField? = null + private var hostedInvoiceUrl: JsonField? = null + private var invoiceDate: JsonField? = null + private var invoiceNumber: JsonField? = null + private var invoicePdf: JsonField? = null + private var invoiceSource: JsonField? = null + private var issueFailedAt: JsonField? = null + private var issuedAt: JsonField? = null + private var memo: JsonField? = null + private var metadata: JsonField? = null + private var paidAt: JsonField? = null + private var paymentAttempts: JsonField>? = null + private var paymentFailedAt: JsonField? = null + private var paymentStartedAt: JsonField? = null + private var scheduledIssueAt: JsonField? = null + private var shippingAddress: JsonField
? = null + private var status: JsonField? = null + private var subscription: JsonField? = null + private var syncFailedAt: JsonField? = null + private var total: JsonField? = null + private var voidedAt: JsonField? = null + private var willAutoIssue: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(invoiceIssueSummaryResponse: InvoiceIssueSummaryResponse) = apply { + id = invoiceIssueSummaryResponse.id + amountDue = invoiceIssueSummaryResponse.amountDue + autoCollection = invoiceIssueSummaryResponse.autoCollection + billingAddress = invoiceIssueSummaryResponse.billingAddress + createdAt = invoiceIssueSummaryResponse.createdAt + creditNotes = invoiceIssueSummaryResponse.creditNotes.map { it.toMutableList() } + currency = invoiceIssueSummaryResponse.currency + customer = invoiceIssueSummaryResponse.customer + customerBalanceTransactions = + invoiceIssueSummaryResponse.customerBalanceTransactions.map { it.toMutableList() } + customerTaxId = invoiceIssueSummaryResponse.customerTaxId + dueDate = invoiceIssueSummaryResponse.dueDate + eligibleToIssueAt = invoiceIssueSummaryResponse.eligibleToIssueAt + hostedInvoiceUrl = invoiceIssueSummaryResponse.hostedInvoiceUrl + invoiceDate = invoiceIssueSummaryResponse.invoiceDate + invoiceNumber = invoiceIssueSummaryResponse.invoiceNumber + invoicePdf = invoiceIssueSummaryResponse.invoicePdf + invoiceSource = invoiceIssueSummaryResponse.invoiceSource + issueFailedAt = invoiceIssueSummaryResponse.issueFailedAt + issuedAt = invoiceIssueSummaryResponse.issuedAt + memo = invoiceIssueSummaryResponse.memo + metadata = invoiceIssueSummaryResponse.metadata + paidAt = invoiceIssueSummaryResponse.paidAt + paymentAttempts = invoiceIssueSummaryResponse.paymentAttempts.map { it.toMutableList() } + paymentFailedAt = invoiceIssueSummaryResponse.paymentFailedAt + paymentStartedAt = invoiceIssueSummaryResponse.paymentStartedAt + scheduledIssueAt = invoiceIssueSummaryResponse.scheduledIssueAt + shippingAddress = invoiceIssueSummaryResponse.shippingAddress + status = invoiceIssueSummaryResponse.status + subscription = invoiceIssueSummaryResponse.subscription + syncFailedAt = invoiceIssueSummaryResponse.syncFailedAt + total = invoiceIssueSummaryResponse.total + voidedAt = invoiceIssueSummaryResponse.voidedAt + willAutoIssue = invoiceIssueSummaryResponse.willAutoIssue + additionalProperties = invoiceIssueSummaryResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * This is the final amount required to be charged to the customer and reflects the + * application of the customer balance to the `total` of the invoice. + */ + fun amountDue(amountDue: String) = amountDue(JsonField.of(amountDue)) + + /** + * Sets [Builder.amountDue] to an arbitrary JSON value. + * + * You should usually call [Builder.amountDue] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun amountDue(amountDue: JsonField) = apply { this.amountDue = amountDue } + + fun autoCollection(autoCollection: AutoCollection) = + autoCollection(JsonField.of(autoCollection)) + + /** + * Sets [Builder.autoCollection] to an arbitrary JSON value. + * + * You should usually call [Builder.autoCollection] with a well-typed [AutoCollection] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun autoCollection(autoCollection: JsonField) = apply { + this.autoCollection = autoCollection + } + + fun billingAddress(billingAddress: Address?) = + billingAddress(JsonField.ofNullable(billingAddress)) + + /** Alias for calling [Builder.billingAddress] with `billingAddress.orElse(null)`. */ + fun billingAddress(billingAddress: Optional
) = + billingAddress(billingAddress.getOrNull()) + + /** + * Sets [Builder.billingAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.billingAddress] with a well-typed [Address] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun billingAddress(billingAddress: JsonField
) = apply { + this.billingAddress = billingAddress + } + + /** The creation time of the resource in Orb. */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + /** A list of credit notes associated with the invoice */ + fun creditNotes(creditNotes: List) = creditNotes(JsonField.of(creditNotes)) + + /** + * Sets [Builder.creditNotes] to an arbitrary JSON value. + * + * You should usually call [Builder.creditNotes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditNotes(creditNotes: JsonField>) = apply { + this.creditNotes = creditNotes.map { it.toMutableList() } + } + + /** + * Adds a single [CreditNote] to [creditNotes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addCreditNote(creditNote: CreditNote) = apply { + creditNotes = + (creditNotes ?: JsonField.of(mutableListOf())).also { + checkKnown("creditNotes", it).add(creditNote) + } + } + + /** An ISO 4217 currency string or `credits` */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + fun customer(customer: CustomerMinified) = customer(JsonField.of(customer)) + + /** + * Sets [Builder.customer] to an arbitrary JSON value. + * + * You should usually call [Builder.customer] with a well-typed [CustomerMinified] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun customer(customer: JsonField) = apply { this.customer = customer } + + fun customerBalanceTransactions( + customerBalanceTransactions: List + ) = customerBalanceTransactions(JsonField.of(customerBalanceTransactions)) + + /** + * Sets [Builder.customerBalanceTransactions] to an arbitrary JSON value. + * + * You should usually call [Builder.customerBalanceTransactions] with a well-typed + * `List` value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun customerBalanceTransactions( + customerBalanceTransactions: JsonField> + ) = apply { + this.customerBalanceTransactions = + customerBalanceTransactions.map { it.toMutableList() } + } + + /** + * Adds a single [CustomerBalanceTransaction] to [customerBalanceTransactions]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addCustomerBalanceTransaction(customerBalanceTransaction: CustomerBalanceTransaction) = + apply { + customerBalanceTransactions = + (customerBalanceTransactions ?: JsonField.of(mutableListOf())).also { + checkKnown("customerBalanceTransactions", it) + .add(customerBalanceTransaction) + } + } + + /** + * Tax IDs are commonly required to be displayed on customer invoices, which are added to + * the headers of invoices. + * + * ### Supported Tax ID Countries and Types + * |Country |Type |Description | + * |----------------------|------------|-------------------------------------------------------------------------------------------------------| + * |Albania |`al_tin` |Albania Tax Identification Number | + * |Andorra |`ad_nrt` |Andorran NRT Number | + * |Angola |`ao_tin` |Angola Tax Identification Number | + * |Argentina |`ar_cuit` |Argentinian Tax ID Number | + * |Armenia |`am_tin` |Armenia Tax Identification Number | + * |Aruba |`aw_tin` |Aruba Tax Identification Number | + * |Australia |`au_abn` |Australian Business Number (AU ABN) | + * |Australia |`au_arn` |Australian Taxation Office Reference Number | + * |Austria |`eu_vat` |European VAT Number | + * |Azerbaijan |`az_tin` |Azerbaijan Tax Identification Number | + * |Bahamas |`bs_tin` |Bahamas Tax Identification Number | + * |Bahrain |`bh_vat` |Bahraini VAT Number | + * |Bangladesh |`bd_bin` |Bangladesh Business Identification Number | + * |Barbados |`bb_tin` |Barbados Tax Identification Number | + * |Belarus |`by_tin` |Belarus TIN Number | + * |Belgium |`eu_vat` |European VAT Number | + * |Benin |`bj_ifu` |Benin Tax Identification Number (Identifiant Fiscal Unique) | + * |Bolivia |`bo_tin` |Bolivian Tax ID | + * |Bosnia and Herzegovina|`ba_tin` |Bosnia and Herzegovina Tax Identification Number | + * |Brazil |`br_cnpj` |Brazilian CNPJ Number | + * |Brazil |`br_cpf` |Brazilian CPF Number | + * |Bulgaria |`bg_uic` |Bulgaria Unified Identification Code | + * |Bulgaria |`eu_vat` |European VAT Number | + * |Burkina Faso |`bf_ifu` |Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + * |Cambodia |`kh_tin` |Cambodia Tax Identification Number | + * |Cameroon |`cm_niu` |Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + * |Canada |`ca_bn` |Canadian BN | + * |Canada |`ca_gst_hst`|Canadian GST/HST Number | + * |Canada |`ca_pst_bc` |Canadian PST Number (British Columbia) | + * |Canada |`ca_pst_mb` |Canadian PST Number (Manitoba) | + * |Canada |`ca_pst_sk` |Canadian PST Number (Saskatchewan) | + * |Canada |`ca_qst` |Canadian QST Number (Québec) | + * |Cape Verde |`cv_nif` |Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + * |Chile |`cl_tin` |Chilean TIN | + * |China |`cn_tin` |Chinese Tax ID | + * |Colombia |`co_nit` |Colombian NIT Number | + * |Congo-Kinshasa |`cd_nif` |Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + * |Costa Rica |`cr_tin` |Costa Rican Tax ID | + * |Croatia |`eu_vat` |European VAT Number | + * |Croatia |`hr_oib` |Croatian Personal Identification Number (OIB) | + * |Cyprus |`eu_vat` |European VAT Number | + * |Czech Republic |`eu_vat` |European VAT Number | + * |Denmark |`eu_vat` |European VAT Number | + * |Dominican Republic |`do_rcn` |Dominican RCN Number | + * |Ecuador |`ec_ruc` |Ecuadorian RUC Number | + * |Egypt |`eg_tin` |Egyptian Tax Identification Number | + * |El Salvador |`sv_nit` |El Salvadorian NIT Number | + * |Estonia |`eu_vat` |European VAT Number | + * |Ethiopia |`et_tin` |Ethiopia Tax Identification Number | + * |European Union |`eu_oss_vat`|European One Stop Shop VAT Number for non-Union scheme | + * |Finland |`eu_vat` |European VAT Number | + * |France |`eu_vat` |European VAT Number | + * |Georgia |`ge_vat` |Georgian VAT | + * |Germany |`de_stn` |German Tax Number (Steuernummer) | + * |Germany |`eu_vat` |European VAT Number | + * |Greece |`eu_vat` |European VAT Number | + * |Guinea |`gn_nif` |Guinea Tax Identification Number (Número de Identificação Fiscal) | + * |Hong Kong |`hk_br` |Hong Kong BR Number | + * |Hungary |`eu_vat` |European VAT Number | + * |Hungary |`hu_tin` |Hungary Tax Number (adószám) | + * |Iceland |`is_vat` |Icelandic VAT | + * |India |`in_gst` |Indian GST Number | + * |Indonesia |`id_npwp` |Indonesian NPWP Number | + * |Ireland |`eu_vat` |European VAT Number | + * |Israel |`il_vat` |Israel VAT | + * |Italy |`eu_vat` |European VAT Number | + * |Japan |`jp_cn` |Japanese Corporate Number (*Hōjin Bangō*) | + * |Japan |`jp_rn` |Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*)| + * |Japan |`jp_trn` |Japanese Tax Registration Number (*Tōroku Bangō*) | + * |Kazakhstan |`kz_bin` |Kazakhstani Business Identification Number | + * |Kenya |`ke_pin` |Kenya Revenue Authority Personal Identification Number | + * |Kyrgyzstan |`kg_tin` |Kyrgyzstan Tax Identification Number | + * |Laos |`la_tin` |Laos Tax Identification Number | + * |Latvia |`eu_vat` |European VAT Number | + * |Liechtenstein |`li_uid` |Liechtensteinian UID Number | + * |Liechtenstein |`li_vat` |Liechtenstein VAT Number | + * |Lithuania |`eu_vat` |European VAT Number | + * |Luxembourg |`eu_vat` |European VAT Number | + * |Malaysia |`my_frp` |Malaysian FRP Number | + * |Malaysia |`my_itn` |Malaysian ITN | + * |Malaysia |`my_sst` |Malaysian SST Number | + * |Malta |`eu_vat` |European VAT Number | + * |Mauritania |`mr_nif` |Mauritania Tax Identification Number (Número de Identificação Fiscal) | + * |Mexico |`mx_rfc` |Mexican RFC Number | + * |Moldova |`md_vat` |Moldova VAT Number | + * |Montenegro |`me_pib` |Montenegro PIB Number | + * |Morocco |`ma_vat` |Morocco VAT Number | + * |Nepal |`np_pan` |Nepal PAN Number | + * |Netherlands |`eu_vat` |European VAT Number | + * |New Zealand |`nz_gst` |New Zealand GST Number | + * |Nigeria |`ng_tin` |Nigerian Tax Identification Number | + * |North Macedonia |`mk_vat` |North Macedonia VAT Number | + * |Northern Ireland |`eu_vat` |Northern Ireland VAT Number | + * |Norway |`no_vat` |Norwegian VAT Number | + * |Norway |`no_voec` |Norwegian VAT on e-commerce Number | + * |Oman |`om_vat` |Omani VAT Number | + * |Peru |`pe_ruc` |Peruvian RUC Number | + * |Philippines |`ph_tin` |Philippines Tax Identification Number | + * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | + * |Portugal |`eu_vat` |European VAT Number | + * |Romania |`eu_vat` |European VAT Number | + * |Romania |`ro_tin` |Romanian Tax ID Number | + * |Russia |`ru_inn` |Russian INN | + * |Russia |`ru_kpp` |Russian KPP | + * |Saudi Arabia |`sa_vat` |Saudi Arabia VAT | + * |Senegal |`sn_ninea` |Senegal NINEA Number | + * |Serbia |`rs_pib` |Serbian PIB Number | + * |Singapore |`sg_gst` |Singaporean GST | + * |Singapore |`sg_uen` |Singaporean UEN | + * |Slovakia |`eu_vat` |European VAT Number | + * |Slovenia |`eu_vat` |European VAT Number | + * |Slovenia |`si_tin` |Slovenia Tax Number (davčna številka) | + * |South Africa |`za_vat` |South African VAT Number | + * |South Korea |`kr_brn` |Korean BRN | + * |Spain |`es_cif` |Spanish NIF Number (previously Spanish CIF Number) | + * |Spain |`eu_vat` |European VAT Number | + * |Suriname |`sr_fin` |Suriname FIN Number | + * |Sweden |`eu_vat` |European VAT Number | + * |Switzerland |`ch_uid` |Switzerland UID Number | + * |Switzerland |`ch_vat` |Switzerland VAT Number | + * |Taiwan |`tw_vat` |Taiwanese VAT | + * |Tajikistan |`tj_tin` |Tajikistan Tax Identification Number | + * |Tanzania |`tz_vat` |Tanzania VAT Number | + * |Thailand |`th_vat` |Thai VAT | + * |Turkey |`tr_tin` |Turkish Tax Identification Number | + * |Uganda |`ug_tin` |Uganda Tax Identification Number | + * |Ukraine |`ua_vat` |Ukrainian VAT | + * |United Arab Emirates |`ae_trn` |United Arab Emirates TRN | + * |United Kingdom |`gb_vat` |United Kingdom VAT Number | + * |United States |`us_ein` |United States EIN | + * |Uruguay |`uy_ruc` |Uruguayan RUC Number | + * |Uzbekistan |`uz_tin` |Uzbekistan TIN Number | + * |Uzbekistan |`uz_vat` |Uzbekistan VAT Number | + * |Venezuela |`ve_rif` |Venezuelan RIF Number | + * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |Zambia |`zm_tin` |Zambia Tax Identification Number | + * |Zimbabwe |`zw_tin` |Zimbabwe Tax Identification Number | + */ + fun customerTaxId(customerTaxId: CustomerTaxId?) = + customerTaxId(JsonField.ofNullable(customerTaxId)) + + /** Alias for calling [Builder.customerTaxId] with `customerTaxId.orElse(null)`. */ + fun customerTaxId(customerTaxId: Optional) = + customerTaxId(customerTaxId.getOrNull()) + + /** + * Sets [Builder.customerTaxId] to an arbitrary JSON value. + * + * You should usually call [Builder.customerTaxId] with a well-typed [CustomerTaxId] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun customerTaxId(customerTaxId: JsonField) = apply { + this.customerTaxId = customerTaxId + } + + /** + * When the invoice payment is due. The due date is null if the invoice is not yet + * finalized. + */ + fun dueDate(dueDate: OffsetDateTime?) = dueDate(JsonField.ofNullable(dueDate)) + + /** Alias for calling [Builder.dueDate] with `dueDate.orElse(null)`. */ + fun dueDate(dueDate: Optional) = dueDate(dueDate.getOrNull()) + + /** + * Sets [Builder.dueDate] to an arbitrary JSON value. + * + * You should usually call [Builder.dueDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dueDate(dueDate: JsonField) = apply { this.dueDate = dueDate } + + /** + * If the invoice has a status of `draft`, this will be the time that the invoice will be + * eligible to be issued, otherwise it will be `null`. If `auto-issue` is true, the invoice + * will automatically begin issuing at this time. + */ + fun eligibleToIssueAt(eligibleToIssueAt: OffsetDateTime?) = + eligibleToIssueAt(JsonField.ofNullable(eligibleToIssueAt)) + + /** Alias for calling [Builder.eligibleToIssueAt] with `eligibleToIssueAt.orElse(null)`. */ + fun eligibleToIssueAt(eligibleToIssueAt: Optional) = + eligibleToIssueAt(eligibleToIssueAt.getOrNull()) + + /** + * Sets [Builder.eligibleToIssueAt] to an arbitrary JSON value. + * + * You should usually call [Builder.eligibleToIssueAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun eligibleToIssueAt(eligibleToIssueAt: JsonField) = apply { + this.eligibleToIssueAt = eligibleToIssueAt + } + + /** + * A URL for the customer-facing invoice portal. This URL expires 30 days after the + * invoice's due date, or 60 days after being re-generated through the UI. + */ + fun hostedInvoiceUrl(hostedInvoiceUrl: String?) = + hostedInvoiceUrl(JsonField.ofNullable(hostedInvoiceUrl)) + + /** Alias for calling [Builder.hostedInvoiceUrl] with `hostedInvoiceUrl.orElse(null)`. */ + fun hostedInvoiceUrl(hostedInvoiceUrl: Optional) = + hostedInvoiceUrl(hostedInvoiceUrl.getOrNull()) + + /** + * Sets [Builder.hostedInvoiceUrl] to an arbitrary JSON value. + * + * You should usually call [Builder.hostedInvoiceUrl] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun hostedInvoiceUrl(hostedInvoiceUrl: JsonField) = apply { + this.hostedInvoiceUrl = hostedInvoiceUrl + } + + /** The scheduled date of the invoice */ + fun invoiceDate(invoiceDate: OffsetDateTime) = invoiceDate(JsonField.of(invoiceDate)) + + /** + * Sets [Builder.invoiceDate] to an arbitrary JSON value. + * + * You should usually call [Builder.invoiceDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun invoiceDate(invoiceDate: JsonField) = apply { + this.invoiceDate = invoiceDate + } + + /** + * Automatically generated invoice number to help track and reconcile invoices. Invoice + * numbers have a prefix such as `RFOBWG`. These can be sequential per account or customer. + */ + fun invoiceNumber(invoiceNumber: String) = invoiceNumber(JsonField.of(invoiceNumber)) + + /** + * Sets [Builder.invoiceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.invoiceNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun invoiceNumber(invoiceNumber: JsonField) = apply { + this.invoiceNumber = invoiceNumber + } + + /** The link to download the PDF representation of the `Invoice`. */ + fun invoicePdf(invoicePdf: String?) = invoicePdf(JsonField.ofNullable(invoicePdf)) + + /** Alias for calling [Builder.invoicePdf] with `invoicePdf.orElse(null)`. */ + fun invoicePdf(invoicePdf: Optional) = invoicePdf(invoicePdf.getOrNull()) + + /** + * Sets [Builder.invoicePdf] to an arbitrary JSON value. + * + * You should usually call [Builder.invoicePdf] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun invoicePdf(invoicePdf: JsonField) = apply { this.invoicePdf = invoicePdf } + + fun invoiceSource(invoiceSource: InvoiceSource) = invoiceSource(JsonField.of(invoiceSource)) + + /** + * Sets [Builder.invoiceSource] to an arbitrary JSON value. + * + * You should usually call [Builder.invoiceSource] with a well-typed [InvoiceSource] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun invoiceSource(invoiceSource: JsonField) = apply { + this.invoiceSource = invoiceSource + } + + /** + * If the invoice failed to issue, this will be the last time it failed to issue (even if it + * is now in a different state.) + */ + fun issueFailedAt(issueFailedAt: OffsetDateTime?) = + issueFailedAt(JsonField.ofNullable(issueFailedAt)) + + /** Alias for calling [Builder.issueFailedAt] with `issueFailedAt.orElse(null)`. */ + fun issueFailedAt(issueFailedAt: Optional) = + issueFailedAt(issueFailedAt.getOrNull()) + + /** + * Sets [Builder.issueFailedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.issueFailedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun issueFailedAt(issueFailedAt: JsonField) = apply { + this.issueFailedAt = issueFailedAt + } + + /** + * If the invoice has been issued, this will be the time it transitioned to `issued` (even + * if it is now in a different state.) + */ + fun issuedAt(issuedAt: OffsetDateTime?) = issuedAt(JsonField.ofNullable(issuedAt)) + + /** Alias for calling [Builder.issuedAt] with `issuedAt.orElse(null)`. */ + fun issuedAt(issuedAt: Optional) = issuedAt(issuedAt.getOrNull()) + + /** + * Sets [Builder.issuedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.issuedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun issuedAt(issuedAt: JsonField) = apply { this.issuedAt = issuedAt } + + /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ + fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) + + /** Alias for calling [Builder.memo] with `memo.orElse(null)`. */ + fun memo(memo: Optional) = memo(memo.getOrNull()) + + /** + * Sets [Builder.memo] to an arbitrary JSON value. + * + * You should usually call [Builder.memo] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun memo(memo: JsonField) = apply { this.memo = memo } + + /** + * 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)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** + * If the invoice has a status of `paid`, this gives a timestamp when the invoice was paid. + */ + fun paidAt(paidAt: OffsetDateTime?) = paidAt(JsonField.ofNullable(paidAt)) + + /** Alias for calling [Builder.paidAt] with `paidAt.orElse(null)`. */ + fun paidAt(paidAt: Optional) = paidAt(paidAt.getOrNull()) + + /** + * Sets [Builder.paidAt] to an arbitrary JSON value. + * + * You should usually call [Builder.paidAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun paidAt(paidAt: JsonField) = apply { this.paidAt = paidAt } + + /** A list of payment attempts associated with the invoice */ + fun paymentAttempts(paymentAttempts: List) = + paymentAttempts(JsonField.of(paymentAttempts)) + + /** + * Sets [Builder.paymentAttempts] to an arbitrary JSON value. + * + * You should usually call [Builder.paymentAttempts] with a well-typed + * `List` value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun paymentAttempts(paymentAttempts: JsonField>) = apply { + this.paymentAttempts = paymentAttempts.map { it.toMutableList() } + } + + /** + * Adds a single [PaymentAttempt] to [paymentAttempts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addPaymentAttempt(paymentAttempt: PaymentAttempt) = apply { + paymentAttempts = + (paymentAttempts ?: JsonField.of(mutableListOf())).also { + checkKnown("paymentAttempts", it).add(paymentAttempt) + } + } + + /** + * If payment was attempted on this invoice but failed, this will be the time of the most + * recent attempt. + */ + fun paymentFailedAt(paymentFailedAt: OffsetDateTime?) = + paymentFailedAt(JsonField.ofNullable(paymentFailedAt)) + + /** Alias for calling [Builder.paymentFailedAt] with `paymentFailedAt.orElse(null)`. */ + fun paymentFailedAt(paymentFailedAt: Optional) = + paymentFailedAt(paymentFailedAt.getOrNull()) + + /** + * Sets [Builder.paymentFailedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.paymentFailedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun paymentFailedAt(paymentFailedAt: JsonField) = apply { + this.paymentFailedAt = paymentFailedAt + } + + /** + * If payment was attempted on this invoice, this will be the start time of the most recent + * attempt. This field is especially useful for delayed-notification payment mechanisms + * (like bank transfers), where payment can take 3 days or more. + */ + fun paymentStartedAt(paymentStartedAt: OffsetDateTime?) = + paymentStartedAt(JsonField.ofNullable(paymentStartedAt)) + + /** Alias for calling [Builder.paymentStartedAt] with `paymentStartedAt.orElse(null)`. */ + fun paymentStartedAt(paymentStartedAt: Optional) = + paymentStartedAt(paymentStartedAt.getOrNull()) + + /** + * Sets [Builder.paymentStartedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.paymentStartedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun paymentStartedAt(paymentStartedAt: JsonField) = apply { + this.paymentStartedAt = paymentStartedAt + } + + /** + * If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to + * be issued. + */ + fun scheduledIssueAt(scheduledIssueAt: OffsetDateTime?) = + scheduledIssueAt(JsonField.ofNullable(scheduledIssueAt)) + + /** Alias for calling [Builder.scheduledIssueAt] with `scheduledIssueAt.orElse(null)`. */ + fun scheduledIssueAt(scheduledIssueAt: Optional) = + scheduledIssueAt(scheduledIssueAt.getOrNull()) + + /** + * Sets [Builder.scheduledIssueAt] to an arbitrary JSON value. + * + * You should usually call [Builder.scheduledIssueAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun scheduledIssueAt(scheduledIssueAt: JsonField) = apply { + this.scheduledIssueAt = scheduledIssueAt + } + + fun shippingAddress(shippingAddress: Address?) = + shippingAddress(JsonField.ofNullable(shippingAddress)) + + /** Alias for calling [Builder.shippingAddress] with `shippingAddress.orElse(null)`. */ + fun shippingAddress(shippingAddress: Optional
) = + shippingAddress(shippingAddress.getOrNull()) + + /** + * Sets [Builder.shippingAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.shippingAddress] with a well-typed [Address] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun shippingAddress(shippingAddress: JsonField
) = apply { + this.shippingAddress = shippingAddress + } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscription(subscription: SubscriptionMinified?) = + subscription(JsonField.ofNullable(subscription)) + + /** Alias for calling [Builder.subscription] with `subscription.orElse(null)`. */ + fun subscription(subscription: Optional) = + subscription(subscription.getOrNull()) + + /** + * Sets [Builder.subscription] to an arbitrary JSON value. + * + * You should usually call [Builder.subscription] with a well-typed [SubscriptionMinified] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun subscription(subscription: JsonField) = apply { + this.subscription = subscription + } + + /** + * If the invoice failed to sync, this will be the last time an external invoicing provider + * sync was attempted. This field will always be `null` for invoices using Orb Invoicing. + */ + fun syncFailedAt(syncFailedAt: OffsetDateTime?) = + syncFailedAt(JsonField.ofNullable(syncFailedAt)) + + /** Alias for calling [Builder.syncFailedAt] with `syncFailedAt.orElse(null)`. */ + fun syncFailedAt(syncFailedAt: Optional) = + syncFailedAt(syncFailedAt.getOrNull()) + + /** + * Sets [Builder.syncFailedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.syncFailedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun syncFailedAt(syncFailedAt: JsonField) = apply { + this.syncFailedAt = syncFailedAt + } + + /** The total after any minimums and discounts have been applied. */ + fun total(total: String) = total(JsonField.of(total)) + + /** + * Sets [Builder.total] to an arbitrary JSON value. + * + * You should usually call [Builder.total] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun total(total: JsonField) = apply { this.total = total } + + /** + * If the invoice has a status of `void`, this gives a timestamp when the invoice was + * voided. + */ + fun voidedAt(voidedAt: OffsetDateTime?) = voidedAt(JsonField.ofNullable(voidedAt)) + + /** Alias for calling [Builder.voidedAt] with `voidedAt.orElse(null)`. */ + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) + + /** + * Sets [Builder.voidedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.voidedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun voidedAt(voidedAt: JsonField) = apply { this.voidedAt = voidedAt } + + /** + * This is true if the invoice will be automatically issued in the future, and false + * otherwise. + */ + fun willAutoIssue(willAutoIssue: Boolean) = willAutoIssue(JsonField.of(willAutoIssue)) + + /** + * Sets [Builder.willAutoIssue] to an arbitrary JSON value. + * + * You should usually call [Builder.willAutoIssue] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun willAutoIssue(willAutoIssue: JsonField) = apply { + this.willAutoIssue = willAutoIssue + } + + 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) + } + + /** + * Returns an immutable instance of [InvoiceIssueSummaryResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .amountDue() + * .autoCollection() + * .billingAddress() + * .createdAt() + * .creditNotes() + * .currency() + * .customer() + * .customerBalanceTransactions() + * .customerTaxId() + * .dueDate() + * .eligibleToIssueAt() + * .hostedInvoiceUrl() + * .invoiceDate() + * .invoiceNumber() + * .invoicePdf() + * .invoiceSource() + * .issueFailedAt() + * .issuedAt() + * .memo() + * .metadata() + * .paidAt() + * .paymentAttempts() + * .paymentFailedAt() + * .paymentStartedAt() + * .scheduledIssueAt() + * .shippingAddress() + * .status() + * .subscription() + * .syncFailedAt() + * .total() + * .voidedAt() + * .willAutoIssue() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InvoiceIssueSummaryResponse = + InvoiceIssueSummaryResponse( + checkRequired("id", id), + checkRequired("amountDue", amountDue), + checkRequired("autoCollection", autoCollection), + checkRequired("billingAddress", billingAddress), + checkRequired("createdAt", createdAt), + checkRequired("creditNotes", creditNotes).map { it.toImmutable() }, + checkRequired("currency", currency), + checkRequired("customer", customer), + checkRequired("customerBalanceTransactions", customerBalanceTransactions).map { + it.toImmutable() + }, + checkRequired("customerTaxId", customerTaxId), + checkRequired("dueDate", dueDate), + checkRequired("eligibleToIssueAt", eligibleToIssueAt), + checkRequired("hostedInvoiceUrl", hostedInvoiceUrl), + checkRequired("invoiceDate", invoiceDate), + checkRequired("invoiceNumber", invoiceNumber), + checkRequired("invoicePdf", invoicePdf), + checkRequired("invoiceSource", invoiceSource), + checkRequired("issueFailedAt", issueFailedAt), + checkRequired("issuedAt", issuedAt), + checkRequired("memo", memo), + checkRequired("metadata", metadata), + checkRequired("paidAt", paidAt), + checkRequired("paymentAttempts", paymentAttempts).map { it.toImmutable() }, + checkRequired("paymentFailedAt", paymentFailedAt), + checkRequired("paymentStartedAt", paymentStartedAt), + checkRequired("scheduledIssueAt", scheduledIssueAt), + checkRequired("shippingAddress", shippingAddress), + checkRequired("status", status), + checkRequired("subscription", subscription), + checkRequired("syncFailedAt", syncFailedAt), + checkRequired("total", total), + checkRequired("voidedAt", voidedAt), + checkRequired("willAutoIssue", willAutoIssue), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): InvoiceIssueSummaryResponse = apply { + if (validated) { + return@apply + } + + id() + amountDue() + autoCollection().validate() + billingAddress().ifPresent { it.validate() } + createdAt() + creditNotes().forEach { it.validate() } + currency() + customer().validate() + customerBalanceTransactions().forEach { it.validate() } + customerTaxId().ifPresent { it.validate() } + dueDate() + eligibleToIssueAt() + hostedInvoiceUrl() + invoiceDate() + invoiceNumber() + invoicePdf() + invoiceSource().validate() + issueFailedAt() + issuedAt() + memo() + metadata().validate() + paidAt() + paymentAttempts().forEach { it.validate() } + paymentFailedAt() + paymentStartedAt() + scheduledIssueAt() + shippingAddress().ifPresent { it.validate() } + status().validate() + subscription().ifPresent { it.validate() } + syncFailedAt() + total() + voidedAt() + willAutoIssue() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (amountDue.asKnown().isPresent) 1 else 0) + + (autoCollection.asKnown().getOrNull()?.validity() ?: 0) + + (billingAddress.asKnown().getOrNull()?.validity() ?: 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (creditNotes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + (customer.asKnown().getOrNull()?.validity() ?: 0) + + (customerBalanceTransactions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } + ?: 0) + + (customerTaxId.asKnown().getOrNull()?.validity() ?: 0) + + (if (dueDate.asKnown().isPresent) 1 else 0) + + (if (eligibleToIssueAt.asKnown().isPresent) 1 else 0) + + (if (hostedInvoiceUrl.asKnown().isPresent) 1 else 0) + + (if (invoiceDate.asKnown().isPresent) 1 else 0) + + (if (invoiceNumber.asKnown().isPresent) 1 else 0) + + (if (invoicePdf.asKnown().isPresent) 1 else 0) + + (invoiceSource.asKnown().getOrNull()?.validity() ?: 0) + + (if (issueFailedAt.asKnown().isPresent) 1 else 0) + + (if (issuedAt.asKnown().isPresent) 1 else 0) + + (if (memo.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (if (paidAt.asKnown().isPresent) 1 else 0) + + (paymentAttempts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (paymentFailedAt.asKnown().isPresent) 1 else 0) + + (if (paymentStartedAt.asKnown().isPresent) 1 else 0) + + (if (scheduledIssueAt.asKnown().isPresent) 1 else 0) + + (shippingAddress.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (subscription.asKnown().getOrNull()?.validity() ?: 0) + + (if (syncFailedAt.asKnown().isPresent) 1 else 0) + + (if (total.asKnown().isPresent) 1 else 0) + + (if (voidedAt.asKnown().isPresent) 1 else 0) + + (if (willAutoIssue.asKnown().isPresent) 1 else 0) + + class AutoCollection + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val enabled: JsonField, + private val nextAttemptAt: JsonField, + private val numAttempts: JsonField, + private val previouslyAttemptedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("enabled") @ExcludeMissing enabled: JsonField = JsonMissing.of(), + @JsonProperty("next_attempt_at") + @ExcludeMissing + nextAttemptAt: JsonField = JsonMissing.of(), + @JsonProperty("num_attempts") + @ExcludeMissing + numAttempts: JsonField = JsonMissing.of(), + @JsonProperty("previously_attempted_at") + @ExcludeMissing + previouslyAttemptedAt: JsonField = JsonMissing.of(), + ) : this(enabled, nextAttemptAt, numAttempts, previouslyAttemptedAt, mutableMapOf()) + + /** + * True only if auto-collection is enabled for this invoice. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun enabled(): Optional = enabled.getOptional("enabled") + + /** + * If the invoice is scheduled for auto-collection, this field will reflect when the next + * attempt will occur. If dunning has been exhausted, or auto-collection is not enabled for + * this invoice, this field will be `null`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun nextAttemptAt(): Optional = nextAttemptAt.getOptional("next_attempt_at") + + /** + * Number of auto-collection payment attempts. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun numAttempts(): Optional = numAttempts.getOptional("num_attempts") + + /** + * If Orb has ever attempted payment auto-collection for this invoice, this field will + * reflect when that attempt occurred. In conjunction with `next_attempt_at`, this can be + * used to tell whether the invoice is currently in dunning (that is, + * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or if + * dunning has been exhausted (`previously_attempted_at` is non-null, but + * `next_attempt_time` is null). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun previouslyAttemptedAt(): Optional = + previouslyAttemptedAt.getOptional("previously_attempted_at") + + /** + * Returns the raw JSON value of [enabled]. + * + * Unlike [enabled], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("enabled") @ExcludeMissing fun _enabled(): JsonField = enabled + + /** + * Returns the raw JSON value of [nextAttemptAt]. + * + * Unlike [nextAttemptAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("next_attempt_at") + @ExcludeMissing + fun _nextAttemptAt(): JsonField = nextAttemptAt + + /** + * Returns the raw JSON value of [numAttempts]. + * + * Unlike [numAttempts], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("num_attempts") + @ExcludeMissing + fun _numAttempts(): JsonField = numAttempts + + /** + * Returns the raw JSON value of [previouslyAttemptedAt]. + * + * Unlike [previouslyAttemptedAt], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("previously_attempted_at") + @ExcludeMissing + fun _previouslyAttemptedAt(): JsonField = previouslyAttemptedAt + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AutoCollection]. + * + * The following fields are required: + * ```java + * .enabled() + * .nextAttemptAt() + * .numAttempts() + * .previouslyAttemptedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AutoCollection]. */ + class Builder internal constructor() { + + private var enabled: JsonField? = null + private var nextAttemptAt: JsonField? = null + private var numAttempts: JsonField? = null + private var previouslyAttemptedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(autoCollection: AutoCollection) = apply { + enabled = autoCollection.enabled + nextAttemptAt = autoCollection.nextAttemptAt + numAttempts = autoCollection.numAttempts + previouslyAttemptedAt = autoCollection.previouslyAttemptedAt + additionalProperties = autoCollection.additionalProperties.toMutableMap() + } + + /** True only if auto-collection is enabled for this invoice. */ + fun enabled(enabled: Boolean?) = enabled(JsonField.ofNullable(enabled)) + + /** + * Alias for [Builder.enabled]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun enabled(enabled: Boolean) = enabled(enabled as Boolean?) + + /** Alias for calling [Builder.enabled] with `enabled.orElse(null)`. */ + fun enabled(enabled: Optional) = enabled(enabled.getOrNull()) + + /** + * Sets [Builder.enabled] to an arbitrary JSON value. + * + * You should usually call [Builder.enabled] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun enabled(enabled: JsonField) = apply { this.enabled = enabled } + + /** + * If the invoice is scheduled for auto-collection, this field will reflect when the + * next attempt will occur. If dunning has been exhausted, or auto-collection is not + * enabled for this invoice, this field will be `null`. + */ + fun nextAttemptAt(nextAttemptAt: OffsetDateTime?) = + nextAttemptAt(JsonField.ofNullable(nextAttemptAt)) + + /** Alias for calling [Builder.nextAttemptAt] with `nextAttemptAt.orElse(null)`. */ + fun nextAttemptAt(nextAttemptAt: Optional) = + nextAttemptAt(nextAttemptAt.getOrNull()) + + /** + * Sets [Builder.nextAttemptAt] to an arbitrary JSON value. + * + * You should usually call [Builder.nextAttemptAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun nextAttemptAt(nextAttemptAt: JsonField) = apply { + this.nextAttemptAt = nextAttemptAt + } + + /** Number of auto-collection payment attempts. */ + fun numAttempts(numAttempts: Long?) = numAttempts(JsonField.ofNullable(numAttempts)) + + /** + * Alias for [Builder.numAttempts]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun numAttempts(numAttempts: Long) = numAttempts(numAttempts as Long?) + + /** Alias for calling [Builder.numAttempts] with `numAttempts.orElse(null)`. */ + fun numAttempts(numAttempts: Optional) = numAttempts(numAttempts.getOrNull()) + + /** + * Sets [Builder.numAttempts] to an arbitrary JSON value. + * + * You should usually call [Builder.numAttempts] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun numAttempts(numAttempts: JsonField) = apply { this.numAttempts = numAttempts } + + /** + * If Orb has ever attempted payment auto-collection for this invoice, this field will + * reflect when that attempt occurred. In conjunction with `next_attempt_at`, this can + * be used to tell whether the invoice is currently in dunning (that is, + * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or if + * dunning has been exhausted (`previously_attempted_at` is non-null, but + * `next_attempt_time` is null). + */ + fun previouslyAttemptedAt(previouslyAttemptedAt: OffsetDateTime?) = + previouslyAttemptedAt(JsonField.ofNullable(previouslyAttemptedAt)) + + /** + * Alias for calling [Builder.previouslyAttemptedAt] with + * `previouslyAttemptedAt.orElse(null)`. + */ + fun previouslyAttemptedAt(previouslyAttemptedAt: Optional) = + previouslyAttemptedAt(previouslyAttemptedAt.getOrNull()) + + /** + * Sets [Builder.previouslyAttemptedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.previouslyAttemptedAt] with a well-typed + * [OffsetDateTime] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun previouslyAttemptedAt(previouslyAttemptedAt: JsonField) = apply { + this.previouslyAttemptedAt = previouslyAttemptedAt + } + + 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) + } + + /** + * Returns an immutable instance of [AutoCollection]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .enabled() + * .nextAttemptAt() + * .numAttempts() + * .previouslyAttemptedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AutoCollection = + AutoCollection( + checkRequired("enabled", enabled), + checkRequired("nextAttemptAt", nextAttemptAt), + checkRequired("numAttempts", numAttempts), + checkRequired("previouslyAttemptedAt", previouslyAttemptedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): AutoCollection = apply { + if (validated) { + return@apply + } + + enabled() + nextAttemptAt() + numAttempts() + previouslyAttemptedAt() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (enabled.asKnown().isPresent) 1 else 0) + + (if (nextAttemptAt.asKnown().isPresent) 1 else 0) + + (if (numAttempts.asKnown().isPresent) 1 else 0) + + (if (previouslyAttemptedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AutoCollection && + enabled == other.enabled && + nextAttemptAt == other.nextAttemptAt && + numAttempts == other.numAttempts && + previouslyAttemptedAt == other.previouslyAttemptedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + enabled, + nextAttemptAt, + numAttempts, + previouslyAttemptedAt, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AutoCollection{enabled=$enabled, nextAttemptAt=$nextAttemptAt, numAttempts=$numAttempts, previouslyAttemptedAt=$previouslyAttemptedAt, additionalProperties=$additionalProperties}" + } + + class CreditNote + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val creditNoteNumber: JsonField, + private val memo: JsonField, + private val reason: JsonField, + private val total: JsonField, + private val type: JsonField, + private val voidedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("credit_note_number") + @ExcludeMissing + creditNoteNumber: JsonField = JsonMissing.of(), + @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(), + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(), + @JsonProperty("total") @ExcludeMissing total: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("voided_at") + @ExcludeMissing + voidedAt: JsonField = JsonMissing.of(), + ) : this(id, creditNoteNumber, memo, reason, total, type, voidedAt, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun creditNoteNumber(): String = creditNoteNumber.getRequired("credit_note_number") + + /** + * An optional memo supplied on the credit note. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun memo(): Optional = memo.getOptional("memo") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun reason(): String = reason.getRequired("reason") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun total(): String = total.getRequired("total") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun type(): String = type.getRequired("type") + + /** + * If the credit note has a status of `void`, this gives a timestamp when the credit note + * was voided. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun voidedAt(): Optional = voidedAt.getOptional("voided_at") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [creditNoteNumber]. + * + * Unlike [creditNoteNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("credit_note_number") + @ExcludeMissing + fun _creditNoteNumber(): JsonField = creditNoteNumber + + /** + * Returns the raw JSON value of [memo]. + * + * Unlike [memo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("memo") @ExcludeMissing fun _memo(): JsonField = memo + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * Returns the raw JSON value of [total]. + * + * Unlike [total], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("total") @ExcludeMissing fun _total(): JsonField = total + + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + + /** + * Returns the raw JSON value of [voidedAt]. + * + * Unlike [voidedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("voided_at") + @ExcludeMissing + fun _voidedAt(): JsonField = voidedAt + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CreditNote]. + * + * The following fields are required: + * ```java + * .id() + * .creditNoteNumber() + * .memo() + * .reason() + * .total() + * .type() + * .voidedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditNote]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var creditNoteNumber: JsonField? = null + private var memo: JsonField? = null + private var reason: JsonField? = null + private var total: JsonField? = null + private var type: JsonField? = null + private var voidedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(creditNote: CreditNote) = apply { + id = creditNote.id + creditNoteNumber = creditNote.creditNoteNumber + memo = creditNote.memo + reason = creditNote.reason + total = creditNote.total + type = creditNote.type + voidedAt = creditNote.voidedAt + additionalProperties = creditNote.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun creditNoteNumber(creditNoteNumber: String) = + creditNoteNumber(JsonField.of(creditNoteNumber)) + + /** + * Sets [Builder.creditNoteNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.creditNoteNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditNoteNumber(creditNoteNumber: JsonField) = apply { + this.creditNoteNumber = creditNoteNumber + } + + /** An optional memo supplied on the credit note. */ + fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) + + /** Alias for calling [Builder.memo] with `memo.orElse(null)`. */ + fun memo(memo: Optional) = memo(memo.getOrNull()) + + /** + * Sets [Builder.memo] to an arbitrary JSON value. + * + * You should usually call [Builder.memo] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun memo(memo: JsonField) = apply { this.memo = memo } + + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun total(total: String) = total(JsonField.of(total)) + + /** + * Sets [Builder.total] to an arbitrary JSON value. + * + * You should usually call [Builder.total] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun total(total: JsonField) = apply { this.total = total } + + fun type(type: String) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun type(type: JsonField) = apply { this.type = type } + + /** + * If the credit note has a status of `void`, this gives a timestamp when the credit + * note was voided. + */ + fun voidedAt(voidedAt: OffsetDateTime?) = voidedAt(JsonField.ofNullable(voidedAt)) + + /** Alias for calling [Builder.voidedAt] with `voidedAt.orElse(null)`. */ + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) + + /** + * Sets [Builder.voidedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.voidedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun voidedAt(voidedAt: JsonField) = apply { this.voidedAt = voidedAt } + + 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) + } + + /** + * Returns an immutable instance of [CreditNote]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .creditNoteNumber() + * .memo() + * .reason() + * .total() + * .type() + * .voidedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreditNote = + CreditNote( + checkRequired("id", id), + checkRequired("creditNoteNumber", creditNoteNumber), + checkRequired("memo", memo), + checkRequired("reason", reason), + checkRequired("total", total), + checkRequired("type", type), + checkRequired("voidedAt", voidedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreditNote = apply { + if (validated) { + return@apply + } + + id() + creditNoteNumber() + memo() + reason() + total() + type() + voidedAt() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (creditNoteNumber.asKnown().isPresent) 1 else 0) + + (if (memo.asKnown().isPresent) 1 else 0) + + (if (reason.asKnown().isPresent) 1 else 0) + + (if (total.asKnown().isPresent) 1 else 0) + + (if (type.asKnown().isPresent) 1 else 0) + + (if (voidedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditNote && + id == other.id && + creditNoteNumber == other.creditNoteNumber && + memo == other.memo && + reason == other.reason && + total == other.total && + type == other.type && + voidedAt == other.voidedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + creditNoteNumber, + memo, + reason, + total, + type, + voidedAt, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditNote{id=$id, creditNoteNumber=$creditNoteNumber, memo=$memo, reason=$reason, total=$total, type=$type, voidedAt=$voidedAt, additionalProperties=$additionalProperties}" + } + + class CustomerBalanceTransaction + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val action: JsonField, + private val amount: JsonField, + private val createdAt: JsonField, + private val creditNote: JsonField, + private val description: JsonField, + private val endingBalance: JsonField, + private val invoice: JsonField, + private val startingBalance: JsonField, + private val type: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("action") @ExcludeMissing action: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("credit_note") + @ExcludeMissing + creditNote: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("ending_balance") + @ExcludeMissing + endingBalance: JsonField = JsonMissing.of(), + @JsonProperty("invoice") + @ExcludeMissing + invoice: JsonField = JsonMissing.of(), + @JsonProperty("starting_balance") + @ExcludeMissing + startingBalance: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + ) : this( + id, + action, + amount, + createdAt, + creditNote, + description, + endingBalance, + invoice, + startingBalance, + type, + mutableMapOf(), + ) + + /** + * A unique id for this transaction. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun action(): Action = action.getRequired("action") + + /** + * The value of the amount changed in the transaction. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): String = amount.getRequired("amount") + + /** + * The creation time of this transaction. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creditNote(): Optional = creditNote.getOptional("credit_note") + + /** + * An optional description provided for manual customer balance adjustments. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun description(): Optional = description.getOptional("description") + + /** + * The new value of the customer's balance prior to the transaction, in the customer's + * currency. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun endingBalance(): String = endingBalance.getRequired("ending_balance") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun invoice(): Optional = invoice.getOptional("invoice") + + /** + * The original value of the customer's balance prior to the transaction, in the customer's + * currency. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun startingBalance(): String = startingBalance.getRequired("starting_balance") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun type(): Type = type.getRequired("type") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [action]. + * + * Unlike [action], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("action") @ExcludeMissing fun _action(): JsonField = action + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [creditNote]. + * + * Unlike [creditNote], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("credit_note") + @ExcludeMissing + fun _creditNote(): JsonField = creditNote + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("description") + @ExcludeMissing + fun _description(): JsonField = description + + /** + * Returns the raw JSON value of [endingBalance]. + * + * Unlike [endingBalance], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ending_balance") + @ExcludeMissing + fun _endingBalance(): JsonField = endingBalance + + /** + * Returns the raw JSON value of [invoice]. + * + * Unlike [invoice], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("invoice") @ExcludeMissing fun _invoice(): JsonField = invoice + + /** + * Returns the raw JSON value of [startingBalance]. + * + * Unlike [startingBalance], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("starting_balance") + @ExcludeMissing + fun _startingBalance(): JsonField = startingBalance + + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CustomerBalanceTransaction]. + * + * The following fields are required: + * ```java + * .id() + * .action() + * .amount() + * .createdAt() + * .creditNote() + * .description() + * .endingBalance() + * .invoice() + * .startingBalance() + * .type() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CustomerBalanceTransaction]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var action: JsonField? = null + private var amount: JsonField? = null + private var createdAt: JsonField? = null + private var creditNote: JsonField? = null + private var description: JsonField? = null + private var endingBalance: JsonField? = null + private var invoice: JsonField? = null + private var startingBalance: JsonField? = null + private var type: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(customerBalanceTransaction: CustomerBalanceTransaction) = apply { + id = customerBalanceTransaction.id + action = customerBalanceTransaction.action + amount = customerBalanceTransaction.amount + createdAt = customerBalanceTransaction.createdAt + creditNote = customerBalanceTransaction.creditNote + description = customerBalanceTransaction.description + endingBalance = customerBalanceTransaction.endingBalance + invoice = customerBalanceTransaction.invoice + startingBalance = customerBalanceTransaction.startingBalance + type = customerBalanceTransaction.type + additionalProperties = + customerBalanceTransaction.additionalProperties.toMutableMap() + } + + /** A unique id for this transaction. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun action(action: Action) = action(JsonField.of(action)) + + /** + * Sets [Builder.action] to an arbitrary JSON value. + * + * You should usually call [Builder.action] with a well-typed [Action] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun action(action: JsonField) = apply { this.action = action } + + /** The value of the amount changed in the transaction. */ + fun amount(amount: String) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The creation time of this transaction. */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt + } + + fun creditNote(creditNote: CreditNoteTiny?) = + creditNote(JsonField.ofNullable(creditNote)) + + /** Alias for calling [Builder.creditNote] with `creditNote.orElse(null)`. */ + fun creditNote(creditNote: Optional) = + creditNote(creditNote.getOrNull()) + + /** + * Sets [Builder.creditNote] to an arbitrary JSON value. + * + * You should usually call [Builder.creditNote] with a well-typed [CreditNoteTiny] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditNote(creditNote: JsonField) = apply { + this.creditNote = creditNote + } + + /** An optional description provided for manual customer balance adjustments. */ + fun description(description: String?) = description(JsonField.ofNullable(description)) + + /** Alias for calling [Builder.description] with `description.orElse(null)`. */ + fun description(description: Optional) = description(description.getOrNull()) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun description(description: JsonField) = apply { + this.description = description + } + + /** + * The new value of the customer's balance prior to the transaction, in the customer's + * currency. + */ + fun endingBalance(endingBalance: String) = endingBalance(JsonField.of(endingBalance)) + + /** + * Sets [Builder.endingBalance] to an arbitrary JSON value. + * + * You should usually call [Builder.endingBalance] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endingBalance(endingBalance: JsonField) = apply { + this.endingBalance = endingBalance + } + + fun invoice(invoice: InvoiceTiny?) = invoice(JsonField.ofNullable(invoice)) + + /** Alias for calling [Builder.invoice] with `invoice.orElse(null)`. */ + fun invoice(invoice: Optional) = invoice(invoice.getOrNull()) + + /** + * Sets [Builder.invoice] to an arbitrary JSON value. + * + * You should usually call [Builder.invoice] with a well-typed [InvoiceTiny] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun invoice(invoice: JsonField) = apply { this.invoice = invoice } + + /** + * The original value of the customer's balance prior to the transaction, in the + * customer's currency. + */ + fun startingBalance(startingBalance: String) = + startingBalance(JsonField.of(startingBalance)) + + /** + * Sets [Builder.startingBalance] to an arbitrary JSON value. + * + * You should usually call [Builder.startingBalance] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startingBalance(startingBalance: JsonField) = apply { + this.startingBalance = startingBalance + } + + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Type] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun type(type: JsonField) = apply { this.type = type } + + 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) + } + + /** + * Returns an immutable instance of [CustomerBalanceTransaction]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .action() + * .amount() + * .createdAt() + * .creditNote() + * .description() + * .endingBalance() + * .invoice() + * .startingBalance() + * .type() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CustomerBalanceTransaction = + CustomerBalanceTransaction( + checkRequired("id", id), + checkRequired("action", action), + checkRequired("amount", amount), + checkRequired("createdAt", createdAt), + checkRequired("creditNote", creditNote), + checkRequired("description", description), + checkRequired("endingBalance", endingBalance), + checkRequired("invoice", invoice), + checkRequired("startingBalance", startingBalance), + checkRequired("type", type), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CustomerBalanceTransaction = apply { + if (validated) { + return@apply + } + + id() + action().validate() + amount() + createdAt() + creditNote().ifPresent { it.validate() } + description() + endingBalance() + invoice().ifPresent { it.validate() } + startingBalance() + type().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (action.asKnown().getOrNull()?.validity() ?: 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (creditNote.asKnown().getOrNull()?.validity() ?: 0) + + (if (description.asKnown().isPresent) 1 else 0) + + (if (endingBalance.asKnown().isPresent) 1 else 0) + + (invoice.asKnown().getOrNull()?.validity() ?: 0) + + (if (startingBalance.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + class Action @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 APPLIED_TO_INVOICE = of("applied_to_invoice") + + @JvmField val MANUAL_ADJUSTMENT = of("manual_adjustment") + + @JvmField val PRORATED_REFUND = of("prorated_refund") + + @JvmField val REVERT_PRORATED_REFUND = of("revert_prorated_refund") + + @JvmField val RETURN_FROM_VOIDING = of("return_from_voiding") + + @JvmField val CREDIT_NOTE_APPLIED = of("credit_note_applied") + + @JvmField val CREDIT_NOTE_VOIDED = of("credit_note_voided") + + @JvmField val OVERPAYMENT_REFUND = of("overpayment_refund") + + @JvmField val EXTERNAL_PAYMENT = of("external_payment") + + @JvmField val SMALL_INVOICE_CARRYOVER = of("small_invoice_carryover") + + @JvmStatic fun of(value: String) = Action(JsonField.of(value)) + } + + /** An enum containing [Action]'s known values. */ + enum class Known { + APPLIED_TO_INVOICE, + MANUAL_ADJUSTMENT, + PRORATED_REFUND, + REVERT_PRORATED_REFUND, + RETURN_FROM_VOIDING, + CREDIT_NOTE_APPLIED, + CREDIT_NOTE_VOIDED, + OVERPAYMENT_REFUND, + EXTERNAL_PAYMENT, + SMALL_INVOICE_CARRYOVER, + } + + /** + * 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, + PRORATED_REFUND, + REVERT_PRORATED_REFUND, + RETURN_FROM_VOIDING, + CREDIT_NOTE_APPLIED, + CREDIT_NOTE_VOIDED, + OVERPAYMENT_REFUND, + EXTERNAL_PAYMENT, + SMALL_INVOICE_CARRYOVER, + /** + * 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 + MANUAL_ADJUSTMENT -> Value.MANUAL_ADJUSTMENT + PRORATED_REFUND -> Value.PRORATED_REFUND + REVERT_PRORATED_REFUND -> Value.REVERT_PRORATED_REFUND + RETURN_FROM_VOIDING -> Value.RETURN_FROM_VOIDING + CREDIT_NOTE_APPLIED -> Value.CREDIT_NOTE_APPLIED + CREDIT_NOTE_VOIDED -> Value.CREDIT_NOTE_VOIDED + OVERPAYMENT_REFUND -> Value.OVERPAYMENT_REFUND + EXTERNAL_PAYMENT -> Value.EXTERNAL_PAYMENT + SMALL_INVOICE_CARRYOVER -> Value.SMALL_INVOICE_CARRYOVER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to 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 + MANUAL_ADJUSTMENT -> Known.MANUAL_ADJUSTMENT + PRORATED_REFUND -> Known.PRORATED_REFUND + REVERT_PRORATED_REFUND -> Known.REVERT_PRORATED_REFUND + RETURN_FROM_VOIDING -> Known.RETURN_FROM_VOIDING + CREDIT_NOTE_APPLIED -> Known.CREDIT_NOTE_APPLIED + CREDIT_NOTE_VOIDED -> Known.CREDIT_NOTE_VOIDED + OVERPAYMENT_REFUND -> Known.OVERPAYMENT_REFUND + EXTERNAL_PAYMENT -> Known.EXTERNAL_PAYMENT + SMALL_INVOICE_CARRYOVER -> Known.SMALL_INVOICE_CARRYOVER + else -> throw OrbInvalidDataException("Unknown Action: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Action = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Action && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class Type @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 INCREMENT = of("increment") + + @JvmField val DECREMENT = of("decrement") + + @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 + 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) { + INCREMENT -> Known.INCREMENT + DECREMENT -> Known.DECREMENT + else -> throw OrbInvalidDataException("Unknown Type: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Type = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Type && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CustomerBalanceTransaction && + id == other.id && + action == other.action && + amount == other.amount && + createdAt == other.createdAt && + creditNote == other.creditNote && + description == other.description && + endingBalance == other.endingBalance && + invoice == other.invoice && + startingBalance == other.startingBalance && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + action, + amount, + createdAt, + creditNote, + description, + endingBalance, + invoice, + startingBalance, + type, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CustomerBalanceTransaction{id=$id, action=$action, amount=$amount, createdAt=$createdAt, creditNote=$creditNote, description=$description, endingBalance=$endingBalance, invoice=$invoice, startingBalance=$startingBalance, type=$type, additionalProperties=$additionalProperties}" + } + + class InvoiceSource @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 SUBSCRIPTION = of("subscription") + + @JvmField val PARTIAL = of("partial") + + @JvmField val ONE_OFF = of("one_off") + + @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 + PARTIAL -> Value.PARTIAL + ONE_OFF -> Value.ONE_OFF + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + PARTIAL -> Known.PARTIAL + ONE_OFF -> Known.ONE_OFF + else -> throw OrbInvalidDataException("Unknown InvoiceSource: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): InvoiceSource = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InvoiceSource && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * 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`. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @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) + } + + /** + * Returns an immutable instance of [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + + class PaymentAttempt + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val amount: JsonField, + private val createdAt: JsonField, + private val paymentProvider: JsonField, + private val paymentProviderId: JsonField, + private val receiptPdf: JsonField, + private val succeeded: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("payment_provider") + @ExcludeMissing + paymentProvider: JsonField = JsonMissing.of(), + @JsonProperty("payment_provider_id") + @ExcludeMissing + paymentProviderId: JsonField = JsonMissing.of(), + @JsonProperty("receipt_pdf") + @ExcludeMissing + receiptPdf: JsonField = JsonMissing.of(), + @JsonProperty("succeeded") + @ExcludeMissing + succeeded: JsonField = JsonMissing.of(), + ) : this( + id, + amount, + createdAt, + paymentProvider, + paymentProviderId, + receiptPdf, + succeeded, + mutableMapOf(), + ) + + /** + * The ID of the payment attempt. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * The amount of the payment attempt. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): String = amount.getRequired("amount") + + /** + * The time at which the payment attempt was created. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * The payment provider that attempted to collect the payment. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun paymentProvider(): Optional = + paymentProvider.getOptional("payment_provider") + + /** + * The ID of the payment attempt in the payment provider. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun paymentProviderId(): Optional = + paymentProviderId.getOptional("payment_provider_id") + + /** + * URL to the downloadable PDF version of the receipt. This field will be `null` for payment + * attempts that did not succeed. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun receiptPdf(): Optional = receiptPdf.getOptional("receipt_pdf") + + /** + * Whether the payment attempt succeeded. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun succeeded(): Boolean = succeeded.getRequired("succeeded") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [paymentProvider]. + * + * Unlike [paymentProvider], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("payment_provider") + @ExcludeMissing + fun _paymentProvider(): JsonField = paymentProvider + + /** + * Returns the raw JSON value of [paymentProviderId]. + * + * Unlike [paymentProviderId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("payment_provider_id") + @ExcludeMissing + fun _paymentProviderId(): JsonField = paymentProviderId + + /** + * Returns the raw JSON value of [receiptPdf]. + * + * Unlike [receiptPdf], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("receipt_pdf") + @ExcludeMissing + fun _receiptPdf(): JsonField = receiptPdf + + /** + * Returns the raw JSON value of [succeeded]. + * + * Unlike [succeeded], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("succeeded") @ExcludeMissing fun _succeeded(): JsonField = succeeded + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [PaymentAttempt]. + * + * The following fields are required: + * ```java + * .id() + * .amount() + * .createdAt() + * .paymentProvider() + * .paymentProviderId() + * .receiptPdf() + * .succeeded() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PaymentAttempt]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var amount: JsonField? = null + private var createdAt: JsonField? = null + private var paymentProvider: JsonField? = null + private var paymentProviderId: JsonField? = null + private var receiptPdf: JsonField? = null + private var succeeded: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentAttempt: PaymentAttempt) = apply { + id = paymentAttempt.id + amount = paymentAttempt.amount + createdAt = paymentAttempt.createdAt + paymentProvider = paymentAttempt.paymentProvider + paymentProviderId = paymentAttempt.paymentProviderId + receiptPdf = paymentAttempt.receiptPdf + succeeded = paymentAttempt.succeeded + additionalProperties = paymentAttempt.additionalProperties.toMutableMap() + } + + /** The ID of the payment attempt. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** The amount of the payment attempt. */ + fun amount(amount: String) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The time at which the payment attempt was created. */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt + } + + /** The payment provider that attempted to collect the payment. */ + fun paymentProvider(paymentProvider: PaymentProvider?) = + paymentProvider(JsonField.ofNullable(paymentProvider)) + + /** Alias for calling [Builder.paymentProvider] with `paymentProvider.orElse(null)`. */ + fun paymentProvider(paymentProvider: Optional) = + paymentProvider(paymentProvider.getOrNull()) + + /** + * Sets [Builder.paymentProvider] to an arbitrary JSON value. + * + * You should usually call [Builder.paymentProvider] with a well-typed [PaymentProvider] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun paymentProvider(paymentProvider: JsonField) = apply { + this.paymentProvider = paymentProvider + } + + /** The ID of the payment attempt in the payment provider. */ + fun paymentProviderId(paymentProviderId: String?) = + paymentProviderId(JsonField.ofNullable(paymentProviderId)) + + /** + * Alias for calling [Builder.paymentProviderId] with `paymentProviderId.orElse(null)`. + */ + fun paymentProviderId(paymentProviderId: Optional) = + paymentProviderId(paymentProviderId.getOrNull()) + + /** + * Sets [Builder.paymentProviderId] to an arbitrary JSON value. + * + * You should usually call [Builder.paymentProviderId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun paymentProviderId(paymentProviderId: JsonField) = apply { + this.paymentProviderId = paymentProviderId + } + + /** + * URL to the downloadable PDF version of the receipt. This field will be `null` for + * payment attempts that did not succeed. + */ + fun receiptPdf(receiptPdf: String?) = receiptPdf(JsonField.ofNullable(receiptPdf)) + + /** Alias for calling [Builder.receiptPdf] with `receiptPdf.orElse(null)`. */ + fun receiptPdf(receiptPdf: Optional) = receiptPdf(receiptPdf.getOrNull()) + + /** + * Sets [Builder.receiptPdf] to an arbitrary JSON value. + * + * You should usually call [Builder.receiptPdf] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun receiptPdf(receiptPdf: JsonField) = apply { this.receiptPdf = receiptPdf } + + /** Whether the payment attempt succeeded. */ + fun succeeded(succeeded: Boolean) = succeeded(JsonField.of(succeeded)) + + /** + * Sets [Builder.succeeded] to an arbitrary JSON value. + * + * You should usually call [Builder.succeeded] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun succeeded(succeeded: JsonField) = apply { this.succeeded = succeeded } + + 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) + } + + /** + * Returns an immutable instance of [PaymentAttempt]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .amount() + * .createdAt() + * .paymentProvider() + * .paymentProviderId() + * .receiptPdf() + * .succeeded() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PaymentAttempt = + PaymentAttempt( + checkRequired("id", id), + checkRequired("amount", amount), + checkRequired("createdAt", createdAt), + checkRequired("paymentProvider", paymentProvider), + checkRequired("paymentProviderId", paymentProviderId), + checkRequired("receiptPdf", receiptPdf), + checkRequired("succeeded", succeeded), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): PaymentAttempt = apply { + if (validated) { + return@apply + } + + id() + amount() + createdAt() + paymentProvider().ifPresent { it.validate() } + paymentProviderId() + receiptPdf() + succeeded() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (paymentProvider.asKnown().getOrNull()?.validity() ?: 0) + + (if (paymentProviderId.asKnown().isPresent) 1 else 0) + + (if (receiptPdf.asKnown().isPresent) 1 else 0) + + (if (succeeded.asKnown().isPresent) 1 else 0) + + /** The payment provider that attempted to collect the payment. */ + class PaymentProvider + @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 STRIPE = of("stripe") + + @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 + else -> throw OrbInvalidDataException("Unknown PaymentProvider: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): PaymentProvider = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentProvider && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentAttempt && + id == other.id && + amount == other.amount && + createdAt == other.createdAt && + paymentProvider == other.paymentProvider && + paymentProviderId == other.paymentProviderId && + receiptPdf == other.receiptPdf && + succeeded == other.succeeded && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + amount, + createdAt, + paymentProvider, + paymentProviderId, + receiptPdf, + succeeded, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PaymentAttempt{id=$id, amount=$amount, createdAt=$createdAt, paymentProvider=$paymentProvider, paymentProviderId=$paymentProviderId, receiptPdf=$receiptPdf, succeeded=$succeeded, additionalProperties=$additionalProperties}" + } + + class Status @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 ISSUED = of("issued") + + @JvmField val PAID = of("paid") + + @JvmField val SYNCED = of("synced") + + @JvmField val VOID = of("void") + + @JvmField val DRAFT = of("draft") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ISSUED, + PAID, + SYNCED, + VOID, + 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 + PAID -> Value.PAID + SYNCED -> Value.SYNCED + VOID -> Value.VOID + DRAFT -> Value.DRAFT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + PAID -> Known.PAID + SYNCED -> Known.SYNCED + VOID -> Known.VOID + DRAFT -> Known.DRAFT + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InvoiceIssueSummaryResponse && + id == other.id && + amountDue == other.amountDue && + autoCollection == other.autoCollection && + billingAddress == other.billingAddress && + createdAt == other.createdAt && + creditNotes == other.creditNotes && + currency == other.currency && + customer == other.customer && + customerBalanceTransactions == other.customerBalanceTransactions && + customerTaxId == other.customerTaxId && + dueDate == other.dueDate && + eligibleToIssueAt == other.eligibleToIssueAt && + hostedInvoiceUrl == other.hostedInvoiceUrl && + invoiceDate == other.invoiceDate && + invoiceNumber == other.invoiceNumber && + invoicePdf == other.invoicePdf && + invoiceSource == other.invoiceSource && + issueFailedAt == other.issueFailedAt && + issuedAt == other.issuedAt && + memo == other.memo && + metadata == other.metadata && + paidAt == other.paidAt && + paymentAttempts == other.paymentAttempts && + paymentFailedAt == other.paymentFailedAt && + paymentStartedAt == other.paymentStartedAt && + scheduledIssueAt == other.scheduledIssueAt && + shippingAddress == other.shippingAddress && + status == other.status && + subscription == other.subscription && + syncFailedAt == other.syncFailedAt && + total == other.total && + voidedAt == other.voidedAt && + willAutoIssue == other.willAutoIssue && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + amountDue, + autoCollection, + billingAddress, + createdAt, + creditNotes, + currency, + customer, + customerBalanceTransactions, + customerTaxId, + dueDate, + eligibleToIssueAt, + hostedInvoiceUrl, + invoiceDate, + invoiceNumber, + invoicePdf, + invoiceSource, + issueFailedAt, + issuedAt, + memo, + metadata, + paidAt, + paymentAttempts, + paymentFailedAt, + paymentStartedAt, + scheduledIssueAt, + shippingAddress, + status, + subscription, + syncFailedAt, + total, + voidedAt, + willAutoIssue, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InvoiceIssueSummaryResponse{id=$id, amountDue=$amountDue, autoCollection=$autoCollection, billingAddress=$billingAddress, createdAt=$createdAt, creditNotes=$creditNotes, currency=$currency, customer=$customer, customerBalanceTransactions=$customerBalanceTransactions, customerTaxId=$customerTaxId, dueDate=$dueDate, eligibleToIssueAt=$eligibleToIssueAt, hostedInvoiceUrl=$hostedInvoiceUrl, invoiceDate=$invoiceDate, invoiceNumber=$invoiceNumber, invoicePdf=$invoicePdf, invoiceSource=$invoiceSource, issueFailedAt=$issueFailedAt, issuedAt=$issuedAt, memo=$memo, metadata=$metadata, paidAt=$paidAt, paymentAttempts=$paymentAttempts, paymentFailedAt=$paymentFailedAt, paymentStartedAt=$paymentStartedAt, scheduledIssueAt=$scheduledIssueAt, shippingAddress=$shippingAddress, status=$status, subscription=$subscription, syncFailedAt=$syncFailedAt, total=$total, voidedAt=$voidedAt, willAutoIssue=$willAutoIssue, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListSummaryResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListSummaryResponse.kt index 64ec70dca..f791ced25 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListSummaryResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListSummaryResponse.kt @@ -355,6 +355,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | @@ -1262,6 +1263,7 @@ private constructor( * |Peru |`pe_ruc` |Peruvian RUC Number | * |Philippines |`ph_tin` |Philippines Tax Identification Number | * |Poland |`eu_vat` |European VAT Number | + * |Poland |`pl_nip` |Polish Tax ID Number | * |Portugal |`eu_vat` |European VAT Number | * |Romania |`eu_vat` |European VAT Number | * |Romania |`ro_tin` |Romanian Tax ID Number | diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseCreateParams.kt new file mode 100644 index 000000000..62de25dfa --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseCreateParams.kt @@ -0,0 +1,761 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +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 +import com.withorb.api.errors.OrbInvalidDataException +import java.time.LocalDate +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * This endpoint is used to create a new license for a user. + * + * If a start date is provided, the license will be activated at the **start** of the specified date + * in the customer's timezone. Otherwise, the activation time will default to the **start** of the + * current day in the customer's timezone. + */ +class LicenseCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The external identifier for the license. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = body.externalLicenseId() + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = body.licenseTypeId() + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = body.subscriptionId() + + /** + * The end date of the license. If not provided, the license will remain active until + * deactivated. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = body.endDate() + + /** + * The start date of the license. If not provided, defaults to start of day today in the + * customer's timezone. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun startDate(): Optional = body.startDate() + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _externalLicenseId(): JsonField = body._externalLicenseId() + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _licenseTypeId(): JsonField = body._licenseTypeId() + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _subscriptionId(): JsonField = body._subscriptionId() + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _endDate(): JsonField = body._endDate() + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _startDate(): JsonField = body._startDate() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseCreateParams]. + * + * The following fields are required: + * ```java + * .externalLicenseId() + * .licenseTypeId() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseCreateParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseCreateParams: LicenseCreateParams) = apply { + body = licenseCreateParams.body.toBuilder() + additionalHeaders = licenseCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [externalLicenseId] + * - [licenseTypeId] + * - [subscriptionId] + * - [endDate] + * - [startDate] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The external identifier for the license. */ + fun externalLicenseId(externalLicenseId: String) = apply { + body.externalLicenseId(externalLicenseId) + } + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + body.externalLicenseId(externalLicenseId) + } + + fun licenseTypeId(licenseTypeId: String) = apply { body.licenseTypeId(licenseTypeId) } + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + body.licenseTypeId(licenseTypeId) + } + + fun subscriptionId(subscriptionId: String) = apply { body.subscriptionId(subscriptionId) } + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + body.subscriptionId(subscriptionId) + } + + /** + * The end date of the license. If not provided, the license will remain active until + * deactivated. + */ + fun endDate(endDate: LocalDate?) = apply { body.endDate(endDate) } + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun endDate(endDate: JsonField) = apply { body.endDate(endDate) } + + /** + * The start date of the license. If not provided, defaults to start of day today in the + * customer's timezone. + */ + fun startDate(startDate: LocalDate?) = apply { body.startDate(startDate) } + + /** Alias for calling [Builder.startDate] with `startDate.orElse(null)`. */ + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [LocalDate] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun startDate(startDate: JsonField) = apply { body.startDate(startDate) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .externalLicenseId() + * .licenseTypeId() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseCreateParams = + LicenseCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val externalLicenseId: JsonField, + private val licenseTypeId: JsonField, + private val subscriptionId: JsonField, + private val endDate: JsonField, + private val startDate: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + ) : this( + externalLicenseId, + licenseTypeId, + subscriptionId, + endDate, + startDate, + mutableMapOf(), + ) + + /** + * The external identifier for the license. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = externalLicenseId.getRequired("external_license_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * The end date of the license. If not provided, the license will remain active until + * deactivated. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * The start date of the license. If not provided, defaults to start of day today in the + * customer's timezone. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun startDate(): Optional = startDate.getOptional("start_date") + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Body]. + * + * The following fields are required: + * ```java + * .externalLicenseId() + * .licenseTypeId() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var externalLicenseId: JsonField? = null + private var licenseTypeId: JsonField? = null + private var subscriptionId: JsonField? = null + private var endDate: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + externalLicenseId = body.externalLicenseId + licenseTypeId = body.licenseTypeId + subscriptionId = body.subscriptionId + endDate = body.endDate + startDate = body.startDate + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The external identifier for the license. */ + fun externalLicenseId(externalLicenseId: String) = + externalLicenseId(JsonField.of(externalLicenseId)) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + fun subscriptionId(subscriptionId: String) = + subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + /** + * The end date of the license. If not provided, the license will remain active until + * deactivated. + */ + fun endDate(endDate: LocalDate?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + /** + * The start date of the license. If not provided, defaults to start of day today in the + * customer's timezone. + */ + fun startDate(startDate: LocalDate?) = startDate(JsonField.ofNullable(startDate)) + + /** Alias for calling [Builder.startDate] with `startDate.orElse(null)`. */ + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + 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) + } + + /** + * Returns an immutable instance of [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .externalLicenseId() + * .licenseTypeId() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Body = + Body( + checkRequired("externalLicenseId", externalLicenseId), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("subscriptionId", subscriptionId), + endDate, + startDate, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + externalLicenseId() + licenseTypeId() + subscriptionId() + endDate() + startDate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + subscriptionId == other.subscriptionId && + endDate == other.endDate && + startDate == other.startDate && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + externalLicenseId, + licenseTypeId, + subscriptionId, + endDate, + startDate, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, subscriptionId=$subscriptionId, endDate=$endDate, startDate=$startDate, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LicenseCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseCreateResponse.kt new file mode 100644 index 000000000..75237ed96 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseCreateResponse.kt @@ -0,0 +1,552 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseCreateResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val endDate: JsonField, + private val externalLicenseId: JsonField, + private val licenseTypeId: JsonField, + private val startDate: JsonField, + private val status: JsonField, + private val subscriptionId: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + ) : this( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = externalLicenseId.getRequired("external_license_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): OffsetDateTime = startDate.getRequired("start_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseCreateResponse]. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseCreateResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var endDate: JsonField? = null + private var externalLicenseId: JsonField? = null + private var licenseTypeId: JsonField? = null + private var startDate: JsonField? = null + private var status: JsonField? = null + private var subscriptionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseCreateResponse: LicenseCreateResponse) = apply { + id = licenseCreateResponse.id + endDate = licenseCreateResponse.endDate + externalLicenseId = licenseCreateResponse.externalLicenseId + licenseTypeId = licenseCreateResponse.licenseTypeId + startDate = licenseCreateResponse.startDate + status = licenseCreateResponse.status + subscriptionId = licenseCreateResponse.subscriptionId + additionalProperties = licenseCreateResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + fun externalLicenseId(externalLicenseId: String) = + externalLicenseId(JsonField.of(externalLicenseId)) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + fun startDate(startDate: OffsetDateTime) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscriptionId(subscriptionId: String) = subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseCreateResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseCreateResponse = + LicenseCreateResponse( + checkRequired("id", id), + checkRequired("endDate", endDate), + checkRequired("externalLicenseId", externalLicenseId), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("startDate", startDate), + checkRequired("status", status), + checkRequired("subscriptionId", subscriptionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseCreateResponse = apply { + if (validated) { + return@apply + } + + id() + endDate() + externalLicenseId() + licenseTypeId() + startDate() + status().validate() + subscriptionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + class Status @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 ACTIVE = of("active") + + @JvmField val INACTIVE = of("inactive") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + INACTIVE, + } + + /** + * 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, + INACTIVE, + /** 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 + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + INACTIVE -> Known.INACTIVE + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseCreateResponse && + id == other.id && + endDate == other.endDate && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + startDate == other.startDate && + status == other.status && + subscriptionId == other.subscriptionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseCreateResponse{id=$id, endDate=$endDate, externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, startDate=$startDate, status=$status, subscriptionId=$subscriptionId, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseDeactivateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseDeactivateParams.kt new file mode 100644 index 000000000..a36a7915f --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseDeactivateParams.kt @@ -0,0 +1,432 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +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 +import java.time.LocalDate +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * This endpoint is used to deactivate an existing license. + * + * If an end date is provided, the license will be deactivated at the **start** of the specified + * date in the customer's timezone. Otherwise, the deactivation time will default to the **end** of + * the current day in the customer's timezone. + */ +class LicenseDeactivateParams +private constructor( + private val licenseId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun licenseId(): Optional = Optional.ofNullable(licenseId) + + /** + * The date to deactivate the license. If not provided, defaults to end of day today in the + * customer's timezone. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = body.endDate() + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _endDate(): JsonField = body._endDate() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): LicenseDeactivateParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [LicenseDeactivateParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseDeactivateParams]. */ + class Builder internal constructor() { + + private var licenseId: String? = null + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseDeactivateParams: LicenseDeactivateParams) = apply { + licenseId = licenseDeactivateParams.licenseId + body = licenseDeactivateParams.body.toBuilder() + additionalHeaders = licenseDeactivateParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseDeactivateParams.additionalQueryParams.toBuilder() + } + + fun licenseId(licenseId: String?) = apply { this.licenseId = licenseId } + + /** Alias for calling [Builder.licenseId] with `licenseId.orElse(null)`. */ + fun licenseId(licenseId: Optional) = licenseId(licenseId.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [endDate] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * The date to deactivate the license. If not provided, defaults to end of day today in the + * customer's timezone. + */ + fun endDate(endDate: LocalDate?) = apply { body.endDate(endDate) } + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun endDate(endDate: JsonField) = apply { body.endDate(endDate) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseDeactivateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LicenseDeactivateParams = + LicenseDeactivateParams( + licenseId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> licenseId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val endDate: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of() + ) : this(endDate, mutableMapOf()) + + /** + * The date to deactivate the license. If not provided, defaults to end of day today in the + * customer's timezone. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var endDate: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + endDate = body.endDate + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * The date to deactivate the license. If not provided, defaults to end of day today in + * the customer's timezone. + */ + fun endDate(endDate: LocalDate?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + 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) + } + + /** + * Returns an immutable instance of [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = Body(endDate, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + endDate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (if (endDate.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + endDate == other.endDate && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(endDate, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{endDate=$endDate, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseDeactivateParams && + licenseId == other.licenseId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(licenseId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LicenseDeactivateParams{licenseId=$licenseId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseDeactivateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseDeactivateResponse.kt new file mode 100644 index 000000000..88150674f --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseDeactivateResponse.kt @@ -0,0 +1,552 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseDeactivateResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val endDate: JsonField, + private val externalLicenseId: JsonField, + private val licenseTypeId: JsonField, + private val startDate: JsonField, + private val status: JsonField, + private val subscriptionId: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + ) : this( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = externalLicenseId.getRequired("external_license_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): OffsetDateTime = startDate.getRequired("start_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseDeactivateResponse]. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseDeactivateResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var endDate: JsonField? = null + private var externalLicenseId: JsonField? = null + private var licenseTypeId: JsonField? = null + private var startDate: JsonField? = null + private var status: JsonField? = null + private var subscriptionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseDeactivateResponse: LicenseDeactivateResponse) = apply { + id = licenseDeactivateResponse.id + endDate = licenseDeactivateResponse.endDate + externalLicenseId = licenseDeactivateResponse.externalLicenseId + licenseTypeId = licenseDeactivateResponse.licenseTypeId + startDate = licenseDeactivateResponse.startDate + status = licenseDeactivateResponse.status + subscriptionId = licenseDeactivateResponse.subscriptionId + additionalProperties = licenseDeactivateResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + fun externalLicenseId(externalLicenseId: String) = + externalLicenseId(JsonField.of(externalLicenseId)) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + fun startDate(startDate: OffsetDateTime) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscriptionId(subscriptionId: String) = subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseDeactivateResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseDeactivateResponse = + LicenseDeactivateResponse( + checkRequired("id", id), + checkRequired("endDate", endDate), + checkRequired("externalLicenseId", externalLicenseId), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("startDate", startDate), + checkRequired("status", status), + checkRequired("subscriptionId", subscriptionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseDeactivateResponse = apply { + if (validated) { + return@apply + } + + id() + endDate() + externalLicenseId() + licenseTypeId() + startDate() + status().validate() + subscriptionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + class Status @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 ACTIVE = of("active") + + @JvmField val INACTIVE = of("inactive") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + INACTIVE, + } + + /** + * 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, + INACTIVE, + /** 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 + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + INACTIVE -> Known.INACTIVE + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseDeactivateResponse && + id == other.id && + endDate == other.endDate && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + startDate == other.startDate && + status == other.status && + subscriptionId == other.subscriptionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseDeactivateResponse{id=$id, endDate=$endDate, externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, startDate=$startDate, status=$status, subscriptionId=$subscriptionId, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageParams.kt new file mode 100644 index 000000000..83028e31c --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageParams.kt @@ -0,0 +1,366 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +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 +import com.withorb.api.core.toImmutable +import java.time.LocalDate +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Returns usage and remaining credits for a license identified by its external license ID. + * + * Date range defaults to the current billing period if not specified. + */ +class LicenseExternalLicenseGetUsageParams +private constructor( + private val externalLicenseId: String?, + private val licenseTypeId: String, + private val subscriptionId: String, + private val cursor: String?, + private val endDate: LocalDate?, + private val groupBy: List?, + private val limit: Long?, + private val startDate: LocalDate?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun externalLicenseId(): Optional = Optional.ofNullable(externalLicenseId) + + /** The license type ID to filter licenses by. */ + fun licenseTypeId(): String = licenseTypeId + + /** The subscription ID to get license usage for. */ + fun subscriptionId(): String = subscriptionId + + /** Pagination cursor from a previous request. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period. */ + fun endDate(): Optional = Optional.ofNullable(endDate) + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + fun groupBy(): Optional> = Optional.ofNullable(groupBy) + + /** Maximum number of rows in the response data (default 20, max 100). */ + fun limit(): Optional = Optional.ofNullable(limit) + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing period. + */ + fun startDate(): Optional = Optional.ofNullable(startDate) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LicenseExternalLicenseGetUsageParams]. + * + * The following fields are required: + * ```java + * .licenseTypeId() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseExternalLicenseGetUsageParams]. */ + class Builder internal constructor() { + + private var externalLicenseId: String? = null + private var licenseTypeId: String? = null + private var subscriptionId: String? = null + private var cursor: String? = null + private var endDate: LocalDate? = null + private var groupBy: MutableList? = null + private var limit: Long? = null + private var startDate: LocalDate? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from( + licenseExternalLicenseGetUsageParams: LicenseExternalLicenseGetUsageParams + ) = apply { + externalLicenseId = licenseExternalLicenseGetUsageParams.externalLicenseId + licenseTypeId = licenseExternalLicenseGetUsageParams.licenseTypeId + subscriptionId = licenseExternalLicenseGetUsageParams.subscriptionId + cursor = licenseExternalLicenseGetUsageParams.cursor + endDate = licenseExternalLicenseGetUsageParams.endDate + groupBy = licenseExternalLicenseGetUsageParams.groupBy?.toMutableList() + limit = licenseExternalLicenseGetUsageParams.limit + startDate = licenseExternalLicenseGetUsageParams.startDate + additionalHeaders = licenseExternalLicenseGetUsageParams.additionalHeaders.toBuilder() + additionalQueryParams = + licenseExternalLicenseGetUsageParams.additionalQueryParams.toBuilder() + } + + fun externalLicenseId(externalLicenseId: String?) = apply { + this.externalLicenseId = externalLicenseId + } + + /** Alias for calling [Builder.externalLicenseId] with `externalLicenseId.orElse(null)`. */ + fun externalLicenseId(externalLicenseId: Optional) = + externalLicenseId(externalLicenseId.getOrNull()) + + /** The license type ID to filter licenses by. */ + fun licenseTypeId(licenseTypeId: String) = apply { this.licenseTypeId = licenseTypeId } + + /** The subscription ID to get license usage for. */ + fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId } + + /** Pagination cursor from a previous request. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** + * End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period. + */ + fun endDate(endDate: LocalDate?) = apply { this.endDate = endDate } + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + fun groupBy(groupBy: List?) = apply { this.groupBy = groupBy?.toMutableList() } + + /** Alias for calling [Builder.groupBy] with `groupBy.orElse(null)`. */ + fun groupBy(groupBy: Optional>) = groupBy(groupBy.getOrNull()) + + /** + * Adds a single [String] to [Builder.groupBy]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addGroupBy(groupBy: String) = apply { + this.groupBy = (this.groupBy ?: mutableListOf()).apply { add(groupBy) } + } + + /** Maximum number of rows in the response data (default 20, max 100). */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing + * period. + */ + fun startDate(startDate: LocalDate?) = apply { this.startDate = startDate } + + /** Alias for calling [Builder.startDate] with `startDate.orElse(null)`. */ + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseExternalLicenseGetUsageParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .licenseTypeId() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseExternalLicenseGetUsageParams = + LicenseExternalLicenseGetUsageParams( + externalLicenseId, + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("subscriptionId", subscriptionId), + cursor, + endDate, + groupBy?.toImmutable(), + limit, + startDate, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> externalLicenseId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + put("license_type_id", licenseTypeId) + put("subscription_id", subscriptionId) + cursor?.let { put("cursor", it) } + endDate?.let { put("end_date", it.toString()) } + groupBy?.forEach { put("group_by[]", it) } + limit?.let { put("limit", it.toString()) } + startDate?.let { put("start_date", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseExternalLicenseGetUsageParams && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + subscriptionId == other.subscriptionId && + cursor == other.cursor && + endDate == other.endDate && + groupBy == other.groupBy && + limit == other.limit && + startDate == other.startDate && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + externalLicenseId, + licenseTypeId, + subscriptionId, + cursor, + endDate, + groupBy, + limit, + startDate, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "LicenseExternalLicenseGetUsageParams{externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, subscriptionId=$subscriptionId, cursor=$cursor, endDate=$endDate, groupBy=$groupBy, limit=$limit, startDate=$startDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageResponse.kt new file mode 100644 index 000000000..4082b8879 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageResponse.kt @@ -0,0 +1,963 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.time.LocalDate +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseExternalLicenseGetUsageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val paginationMetadata: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(), + @JsonProperty("pagination_metadata") + @ExcludeMissing + paginationMetadata: JsonField = JsonMissing.of(), + ) : this(data, paginationMetadata, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun paginationMetadata(): PaginationMetadata = + paginationMetadata.getRequired("pagination_metadata") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [paginationMetadata]. + * + * Unlike [paginationMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pagination_metadata") + @ExcludeMissing + fun _paginationMetadata(): JsonField = paginationMetadata + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LicenseExternalLicenseGetUsageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseExternalLicenseGetUsageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var paginationMetadata: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + licenseExternalLicenseGetUsageResponse: LicenseExternalLicenseGetUsageResponse + ) = apply { + data = licenseExternalLicenseGetUsageResponse.data.map { it.toMutableList() } + paginationMetadata = licenseExternalLicenseGetUsageResponse.paginationMetadata + additionalProperties = + licenseExternalLicenseGetUsageResponse.additionalProperties.toMutableMap() + } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [Data] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: Data) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + fun paginationMetadata(paginationMetadata: PaginationMetadata) = + paginationMetadata(JsonField.of(paginationMetadata)) + + /** + * Sets [Builder.paginationMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.paginationMetadata] with a well-typed + * [PaginationMetadata] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun paginationMetadata(paginationMetadata: JsonField) = apply { + this.paginationMetadata = paginationMetadata + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseExternalLicenseGetUsageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseExternalLicenseGetUsageResponse = + LicenseExternalLicenseGetUsageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("paginationMetadata", paginationMetadata), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseExternalLicenseGetUsageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + paginationMetadata().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (paginationMetadata.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The LicenseUsage resource represents usage and remaining credits for a license over a date + * range. + * + * When grouped by 'day' only, license_id and external_license_id will be null as the data is + * aggregated across all licenses. + */ + class Data + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val allocatedCredits: JsonField, + private val consumedCredits: JsonField, + private val endDate: JsonField, + private val licenseTypeId: JsonField, + private val pricingUnit: JsonField, + private val remainingCredits: JsonField, + private val startDate: JsonField, + private val subscriptionId: JsonField, + private val allocationEligibleCredits: JsonField, + private val externalLicenseId: JsonField, + private val licenseId: JsonField, + private val sharedPoolCredits: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("allocated_credits") + @ExcludeMissing + allocatedCredits: JsonField = JsonMissing.of(), + @JsonProperty("consumed_credits") + @ExcludeMissing + consumedCredits: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("pricing_unit") + @ExcludeMissing + pricingUnit: JsonField = JsonMissing.of(), + @JsonProperty("remaining_credits") + @ExcludeMissing + remainingCredits: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + @JsonProperty("allocation_eligible_credits") + @ExcludeMissing + allocationEligibleCredits: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_id") + @ExcludeMissing + licenseId: JsonField = JsonMissing.of(), + @JsonProperty("shared_pool_credits") + @ExcludeMissing + sharedPoolCredits: JsonField = JsonMissing.of(), + ) : this( + allocatedCredits, + consumedCredits, + endDate, + licenseTypeId, + pricingUnit, + remainingCredits, + startDate, + subscriptionId, + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + mutableMapOf(), + ) + + /** + * The total credits allocated to this license for the period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun allocatedCredits(): Double = allocatedCredits.getRequired("allocated_credits") + + /** + * The credits consumed by this license for the period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun consumedCredits(): Double = consumedCredits.getRequired("consumed_credits") + + /** + * The end date of the usage period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun endDate(): LocalDate = endDate.getRequired("end_date") + + /** + * The unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * The pricing unit for the credits (e.g., 'credits'). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun pricingUnit(): String = pricingUnit.getRequired("pricing_unit") + + /** + * The remaining credits available for this license (allocated - consumed). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun remainingCredits(): Double = remainingCredits.getRequired("remaining_credits") + + /** + * The start date of the usage period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): LocalDate = startDate.getRequired("start_date") + + /** + * The unique identifier for the subscription. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Credits consumed while the license was active (eligible for individual allocation + * deduction). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun allocationEligibleCredits(): Optional = + allocationEligibleCredits.getOptional("allocation_eligible_credits") + + /** + * The external identifier for the license. Null when grouped by day only. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalLicenseId(): Optional = + externalLicenseId.getOptional("external_license_id") + + /** + * The unique identifier for the license. Null when grouped by day only. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseId(): Optional = licenseId.getOptional("license_id") + + /** + * Credits consumed while the license was inactive (draws from shared pool, not individual + * allocation). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sharedPoolCredits(): Optional = + sharedPoolCredits.getOptional("shared_pool_credits") + + /** + * Returns the raw JSON value of [allocatedCredits]. + * + * Unlike [allocatedCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("allocated_credits") + @ExcludeMissing + fun _allocatedCredits(): JsonField = allocatedCredits + + /** + * Returns the raw JSON value of [consumedCredits]. + * + * Unlike [consumedCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("consumed_credits") + @ExcludeMissing + fun _consumedCredits(): JsonField = consumedCredits + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [pricingUnit]. + * + * Unlike [pricingUnit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pricing_unit") + @ExcludeMissing + fun _pricingUnit(): JsonField = pricingUnit + + /** + * Returns the raw JSON value of [remainingCredits]. + * + * Unlike [remainingCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("remaining_credits") + @ExcludeMissing + fun _remainingCredits(): JsonField = remainingCredits + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + /** + * Returns the raw JSON value of [allocationEligibleCredits]. + * + * Unlike [allocationEligibleCredits], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("allocation_eligible_credits") + @ExcludeMissing + fun _allocationEligibleCredits(): JsonField = allocationEligibleCredits + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseId]. + * + * Unlike [licenseId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_id") @ExcludeMissing fun _licenseId(): JsonField = licenseId + + /** + * Returns the raw JSON value of [sharedPoolCredits]. + * + * Unlike [sharedPoolCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("shared_pool_credits") + @ExcludeMissing + fun _sharedPoolCredits(): JsonField = sharedPoolCredits + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Data]. + * + * The following fields are required: + * ```java + * .allocatedCredits() + * .consumedCredits() + * .endDate() + * .licenseTypeId() + * .pricingUnit() + * .remainingCredits() + * .startDate() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Data]. */ + class Builder internal constructor() { + + private var allocatedCredits: JsonField? = null + private var consumedCredits: JsonField? = null + private var endDate: JsonField? = null + private var licenseTypeId: JsonField? = null + private var pricingUnit: JsonField? = null + private var remainingCredits: JsonField? = null + private var startDate: JsonField? = null + private var subscriptionId: JsonField? = null + private var allocationEligibleCredits: JsonField = JsonMissing.of() + private var externalLicenseId: JsonField = JsonMissing.of() + private var licenseId: JsonField = JsonMissing.of() + private var sharedPoolCredits: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(data: Data) = apply { + allocatedCredits = data.allocatedCredits + consumedCredits = data.consumedCredits + endDate = data.endDate + licenseTypeId = data.licenseTypeId + pricingUnit = data.pricingUnit + remainingCredits = data.remainingCredits + startDate = data.startDate + subscriptionId = data.subscriptionId + allocationEligibleCredits = data.allocationEligibleCredits + externalLicenseId = data.externalLicenseId + licenseId = data.licenseId + sharedPoolCredits = data.sharedPoolCredits + additionalProperties = data.additionalProperties.toMutableMap() + } + + /** The total credits allocated to this license for the period. */ + fun allocatedCredits(allocatedCredits: Double) = + allocatedCredits(JsonField.of(allocatedCredits)) + + /** + * Sets [Builder.allocatedCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.allocatedCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun allocatedCredits(allocatedCredits: JsonField) = apply { + this.allocatedCredits = allocatedCredits + } + + /** The credits consumed by this license for the period. */ + fun consumedCredits(consumedCredits: Double) = + consumedCredits(JsonField.of(consumedCredits)) + + /** + * Sets [Builder.consumedCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.consumedCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun consumedCredits(consumedCredits: JsonField) = apply { + this.consumedCredits = consumedCredits + } + + /** The end date of the usage period. */ + fun endDate(endDate: LocalDate) = endDate(JsonField.of(endDate)) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + /** The unique identifier for the license type. */ + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + /** The pricing unit for the credits (e.g., 'credits'). */ + fun pricingUnit(pricingUnit: String) = pricingUnit(JsonField.of(pricingUnit)) + + /** + * Sets [Builder.pricingUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.pricingUnit] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pricingUnit(pricingUnit: JsonField) = apply { + this.pricingUnit = pricingUnit + } + + /** The remaining credits available for this license (allocated - consumed). */ + fun remainingCredits(remainingCredits: Double) = + remainingCredits(JsonField.of(remainingCredits)) + + /** + * Sets [Builder.remainingCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.remainingCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun remainingCredits(remainingCredits: JsonField) = apply { + this.remainingCredits = remainingCredits + } + + /** The start date of the usage period. */ + fun startDate(startDate: LocalDate) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + /** The unique identifier for the subscription. */ + fun subscriptionId(subscriptionId: String) = + subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + /** + * Credits consumed while the license was active (eligible for individual allocation + * deduction). + */ + fun allocationEligibleCredits(allocationEligibleCredits: Double?) = + allocationEligibleCredits(JsonField.ofNullable(allocationEligibleCredits)) + + /** + * Alias for [Builder.allocationEligibleCredits]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun allocationEligibleCredits(allocationEligibleCredits: Double) = + allocationEligibleCredits(allocationEligibleCredits as Double?) + + /** + * Alias for calling [Builder.allocationEligibleCredits] with + * `allocationEligibleCredits.orElse(null)`. + */ + fun allocationEligibleCredits(allocationEligibleCredits: Optional) = + allocationEligibleCredits(allocationEligibleCredits.getOrNull()) + + /** + * Sets [Builder.allocationEligibleCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.allocationEligibleCredits] with a well-typed + * [Double] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun allocationEligibleCredits(allocationEligibleCredits: JsonField) = apply { + this.allocationEligibleCredits = allocationEligibleCredits + } + + /** The external identifier for the license. Null when grouped by day only. */ + fun externalLicenseId(externalLicenseId: String?) = + externalLicenseId(JsonField.ofNullable(externalLicenseId)) + + /** + * Alias for calling [Builder.externalLicenseId] with `externalLicenseId.orElse(null)`. + */ + fun externalLicenseId(externalLicenseId: Optional) = + externalLicenseId(externalLicenseId.getOrNull()) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + /** The unique identifier for the license. Null when grouped by day only. */ + fun licenseId(licenseId: String?) = licenseId(JsonField.ofNullable(licenseId)) + + /** Alias for calling [Builder.licenseId] with `licenseId.orElse(null)`. */ + fun licenseId(licenseId: Optional) = licenseId(licenseId.getOrNull()) + + /** + * Sets [Builder.licenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseId(licenseId: JsonField) = apply { this.licenseId = licenseId } + + /** + * Credits consumed while the license was inactive (draws from shared pool, not + * individual allocation). + */ + fun sharedPoolCredits(sharedPoolCredits: Double?) = + sharedPoolCredits(JsonField.ofNullable(sharedPoolCredits)) + + /** + * Alias for [Builder.sharedPoolCredits]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun sharedPoolCredits(sharedPoolCredits: Double) = + sharedPoolCredits(sharedPoolCredits as Double?) + + /** + * Alias for calling [Builder.sharedPoolCredits] with `sharedPoolCredits.orElse(null)`. + */ + fun sharedPoolCredits(sharedPoolCredits: Optional) = + sharedPoolCredits(sharedPoolCredits.getOrNull()) + + /** + * Sets [Builder.sharedPoolCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.sharedPoolCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sharedPoolCredits(sharedPoolCredits: JsonField) = apply { + this.sharedPoolCredits = sharedPoolCredits + } + + 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) + } + + /** + * Returns an immutable instance of [Data]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .allocatedCredits() + * .consumedCredits() + * .endDate() + * .licenseTypeId() + * .pricingUnit() + * .remainingCredits() + * .startDate() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Data = + Data( + checkRequired("allocatedCredits", allocatedCredits), + checkRequired("consumedCredits", consumedCredits), + checkRequired("endDate", endDate), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("pricingUnit", pricingUnit), + checkRequired("remainingCredits", remainingCredits), + checkRequired("startDate", startDate), + checkRequired("subscriptionId", subscriptionId), + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Data = apply { + if (validated) { + return@apply + } + + allocatedCredits() + consumedCredits() + endDate() + licenseTypeId() + pricingUnit() + remainingCredits() + startDate() + subscriptionId() + allocationEligibleCredits() + externalLicenseId() + licenseId() + sharedPoolCredits() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (allocatedCredits.asKnown().isPresent) 1 else 0) + + (if (consumedCredits.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (pricingUnit.asKnown().isPresent) 1 else 0) + + (if (remainingCredits.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + (if (allocationEligibleCredits.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseId.asKnown().isPresent) 1 else 0) + + (if (sharedPoolCredits.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Data && + allocatedCredits == other.allocatedCredits && + consumedCredits == other.consumedCredits && + endDate == other.endDate && + licenseTypeId == other.licenseTypeId && + pricingUnit == other.pricingUnit && + remainingCredits == other.remainingCredits && + startDate == other.startDate && + subscriptionId == other.subscriptionId && + allocationEligibleCredits == other.allocationEligibleCredits && + externalLicenseId == other.externalLicenseId && + licenseId == other.licenseId && + sharedPoolCredits == other.sharedPoolCredits && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + allocatedCredits, + consumedCredits, + endDate, + licenseTypeId, + pricingUnit, + remainingCredits, + startDate, + subscriptionId, + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Data{allocatedCredits=$allocatedCredits, consumedCredits=$consumedCredits, endDate=$endDate, licenseTypeId=$licenseTypeId, pricingUnit=$pricingUnit, remainingCredits=$remainingCredits, startDate=$startDate, subscriptionId=$subscriptionId, allocationEligibleCredits=$allocationEligibleCredits, externalLicenseId=$externalLicenseId, licenseId=$licenseId, sharedPoolCredits=$sharedPoolCredits, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseExternalLicenseGetUsageResponse && + data == other.data && + paginationMetadata == other.paginationMetadata && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(data, paginationMetadata, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseExternalLicenseGetUsageResponse{data=$data, paginationMetadata=$paginationMetadata, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPage.kt new file mode 100644 index 000000000..9a7b44475 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPage.kt @@ -0,0 +1,136 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.AutoPager +import com.withorb.api.core.Page +import com.withorb.api.core.checkRequired +import com.withorb.api.services.blocking.LicenseService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see LicenseService.list */ +class LicenseListPage +private constructor( + private val service: LicenseService, + private val params: LicenseListParams, + private val response: LicenseListPageResponse, +) : Page { + + /** + * Delegates to [LicenseListPageResponse], but gracefully handles missing data. + * + * @see LicenseListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LicenseListPageResponse], but gracefully handles missing data. + * + * @see LicenseListPageResponse.paginationMetadata + */ + fun paginationMetadata(): Optional = + response._paginationMetadata().getOptional("pagination_metadata") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = + items().isNotEmpty() && + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.isPresent + + fun nextPageParams(): LicenseListParams { + val nextCursor = + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): LicenseListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): LicenseListParams = params + + /** The response that this page was parsed from. */ + fun response(): LicenseListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseListPage]. */ + class Builder internal constructor() { + + private var service: LicenseService? = null + private var params: LicenseListParams? = null + private var response: LicenseListPageResponse? = null + + @JvmSynthetic + internal fun from(licenseListPage: LicenseListPage) = apply { + service = licenseListPage.service + params = licenseListPage.params + response = licenseListPage.response + } + + fun service(service: LicenseService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: LicenseListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LicenseListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [LicenseListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseListPage = + LicenseListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "LicenseListPage{service=$service, params=$params, response=$response}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPageAsync.kt new file mode 100644 index 000000000..e0d605def --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.AutoPagerAsync +import com.withorb.api.core.PageAsync +import com.withorb.api.core.checkRequired +import com.withorb.api.services.async.LicenseServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see LicenseServiceAsync.list */ +class LicenseListPageAsync +private constructor( + private val service: LicenseServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: LicenseListParams, + private val response: LicenseListPageResponse, +) : PageAsync { + + /** + * Delegates to [LicenseListPageResponse], but gracefully handles missing data. + * + * @see LicenseListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LicenseListPageResponse], but gracefully handles missing data. + * + * @see LicenseListPageResponse.paginationMetadata + */ + fun paginationMetadata(): Optional = + response._paginationMetadata().getOptional("pagination_metadata") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = + items().isNotEmpty() && + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.isPresent + + fun nextPageParams(): LicenseListParams { + val nextCursor = + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): LicenseListParams = params + + /** The response that this page was parsed from. */ + fun response(): LicenseListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseListPageAsync]. */ + class Builder internal constructor() { + + private var service: LicenseServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: LicenseListParams? = null + private var response: LicenseListPageResponse? = null + + @JvmSynthetic + internal fun from(licenseListPageAsync: LicenseListPageAsync) = apply { + service = licenseListPageAsync.service + streamHandlerExecutor = licenseListPageAsync.streamHandlerExecutor + params = licenseListPageAsync.params + response = licenseListPageAsync.response + } + + fun service(service: LicenseServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: LicenseListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LicenseListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [LicenseListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseListPageAsync = + LicenseListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "LicenseListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPageResponse.kt new file mode 100644 index 000000000..314b0b112 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListPageResponse.kt @@ -0,0 +1,237 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Collections +import java.util.Objects +import kotlin.jvm.optionals.getOrNull + +class LicenseListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val paginationMetadata: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("pagination_metadata") + @ExcludeMissing + paginationMetadata: JsonField = JsonMissing.of(), + ) : this(data, paginationMetadata, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun paginationMetadata(): PaginationMetadata = + paginationMetadata.getRequired("pagination_metadata") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [paginationMetadata]. + * + * Unlike [paginationMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pagination_metadata") + @ExcludeMissing + fun _paginationMetadata(): JsonField = paginationMetadata + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var paginationMetadata: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseListPageResponse: LicenseListPageResponse) = apply { + data = licenseListPageResponse.data.map { it.toMutableList() } + paginationMetadata = licenseListPageResponse.paginationMetadata + additionalProperties = licenseListPageResponse.additionalProperties.toMutableMap() + } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [LicenseListResponse] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: LicenseListResponse) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + fun paginationMetadata(paginationMetadata: PaginationMetadata) = + paginationMetadata(JsonField.of(paginationMetadata)) + + /** + * Sets [Builder.paginationMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.paginationMetadata] with a well-typed + * [PaginationMetadata] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun paginationMetadata(paginationMetadata: JsonField) = apply { + this.paginationMetadata = paginationMetadata + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseListPageResponse = + LicenseListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("paginationMetadata", paginationMetadata), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + paginationMetadata().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (paginationMetadata.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseListPageResponse && + data == other.data && + paginationMetadata == other.paginationMetadata && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(data, paginationMetadata, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseListPageResponse{data=$data, paginationMetadata=$paginationMetadata, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListParams.kt new file mode 100644 index 000000000..d28a59325 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListParams.kt @@ -0,0 +1,427 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonCreator +import com.withorb.api.core.Enum +import com.withorb.api.core.JsonField +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 +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** This endpoint returns a list of all licenses for a subscription. */ +class LicenseListParams +private constructor( + private val subscriptionId: String, + private val cursor: String?, + private val externalLicenseId: String?, + private val licenseTypeId: String?, + private val limit: Long?, + private val status: Status?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun subscriptionId(): String = subscriptionId + + /** + * Cursor for pagination. This can be populated by the `next_cursor` value returned from the + * initial request. + */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + fun externalLicenseId(): Optional = Optional.ofNullable(externalLicenseId) + + fun licenseTypeId(): Optional = Optional.ofNullable(licenseTypeId) + + /** The number of items to fetch. Defaults to 20. */ + fun limit(): Optional = Optional.ofNullable(limit) + + fun status(): Optional = Optional.ofNullable(status) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseListParams]. + * + * The following fields are required: + * ```java + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseListParams]. */ + class Builder internal constructor() { + + private var subscriptionId: String? = null + private var cursor: String? = null + private var externalLicenseId: String? = null + private var licenseTypeId: String? = null + private var limit: Long? = null + private var status: Status? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseListParams: LicenseListParams) = apply { + subscriptionId = licenseListParams.subscriptionId + cursor = licenseListParams.cursor + externalLicenseId = licenseListParams.externalLicenseId + licenseTypeId = licenseListParams.licenseTypeId + limit = licenseListParams.limit + status = licenseListParams.status + additionalHeaders = licenseListParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseListParams.additionalQueryParams.toBuilder() + } + + fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId } + + /** + * Cursor for pagination. This can be populated by the `next_cursor` value returned from the + * initial request. + */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + fun externalLicenseId(externalLicenseId: String?) = apply { + this.externalLicenseId = externalLicenseId + } + + /** Alias for calling [Builder.externalLicenseId] with `externalLicenseId.orElse(null)`. */ + fun externalLicenseId(externalLicenseId: Optional) = + externalLicenseId(externalLicenseId.getOrNull()) + + fun licenseTypeId(licenseTypeId: String?) = apply { this.licenseTypeId = licenseTypeId } + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** The number of items to fetch. Defaults to 20. */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + fun status(status: Status?) = apply { this.status = status } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseListParams = + LicenseListParams( + checkRequired("subscriptionId", subscriptionId), + cursor, + externalLicenseId, + licenseTypeId, + limit, + status, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + put("subscription_id", subscriptionId) + cursor?.let { put("cursor", it) } + externalLicenseId?.let { put("external_license_id", it) } + licenseTypeId?.let { put("license_type_id", it) } + limit?.let { put("limit", it.toString()) } + status?.let { put("status", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + class Status @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 ACTIVE = of("active") + + @JvmField val INACTIVE = of("inactive") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + INACTIVE, + } + + /** + * 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, + INACTIVE, + /** 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 + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + INACTIVE -> Known.INACTIVE + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseListParams && + subscriptionId == other.subscriptionId && + cursor == other.cursor && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + limit == other.limit && + status == other.status && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + subscriptionId, + cursor, + externalLicenseId, + licenseTypeId, + limit, + status, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "LicenseListParams{subscriptionId=$subscriptionId, cursor=$cursor, externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, limit=$limit, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListResponse.kt new file mode 100644 index 000000000..2e884a670 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseListResponse.kt @@ -0,0 +1,552 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseListResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val endDate: JsonField, + private val externalLicenseId: JsonField, + private val licenseTypeId: JsonField, + private val startDate: JsonField, + private val status: JsonField, + private val subscriptionId: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + ) : this( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = externalLicenseId.getRequired("external_license_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): OffsetDateTime = startDate.getRequired("start_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseListResponse]. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseListResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var endDate: JsonField? = null + private var externalLicenseId: JsonField? = null + private var licenseTypeId: JsonField? = null + private var startDate: JsonField? = null + private var status: JsonField? = null + private var subscriptionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseListResponse: LicenseListResponse) = apply { + id = licenseListResponse.id + endDate = licenseListResponse.endDate + externalLicenseId = licenseListResponse.externalLicenseId + licenseTypeId = licenseListResponse.licenseTypeId + startDate = licenseListResponse.startDate + status = licenseListResponse.status + subscriptionId = licenseListResponse.subscriptionId + additionalProperties = licenseListResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + fun externalLicenseId(externalLicenseId: String) = + externalLicenseId(JsonField.of(externalLicenseId)) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + fun startDate(startDate: OffsetDateTime) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscriptionId(subscriptionId: String) = subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseListResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseListResponse = + LicenseListResponse( + checkRequired("id", id), + checkRequired("endDate", endDate), + checkRequired("externalLicenseId", externalLicenseId), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("startDate", startDate), + checkRequired("status", status), + checkRequired("subscriptionId", subscriptionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseListResponse = apply { + if (validated) { + return@apply + } + + id() + endDate() + externalLicenseId() + licenseTypeId() + startDate() + status().validate() + subscriptionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + class Status @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 ACTIVE = of("active") + + @JvmField val INACTIVE = of("inactive") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + INACTIVE, + } + + /** + * 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, + INACTIVE, + /** 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 + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + INACTIVE -> Known.INACTIVE + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseListResponse && + id == other.id && + endDate == other.endDate && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + startDate == other.startDate && + status == other.status && + subscriptionId == other.subscriptionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseListResponse{id=$id, endDate=$endDate, externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, startDate=$startDate, status=$status, subscriptionId=$subscriptionId, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdParams.kt new file mode 100644 index 000000000..0f9be2744 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdParams.kt @@ -0,0 +1,250 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +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 +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** This endpoint is used to fetch a license given an external license identifier. */ +class LicenseRetrieveByExternalIdParams +private constructor( + private val externalLicenseId: String?, + private val licenseTypeId: String, + private val subscriptionId: String, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun externalLicenseId(): Optional = Optional.ofNullable(externalLicenseId) + + /** The ID of the license type to fetch the license for. */ + fun licenseTypeId(): String = licenseTypeId + + /** The ID of the subscription to fetch the license for. */ + fun subscriptionId(): String = subscriptionId + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LicenseRetrieveByExternalIdParams]. + * + * The following fields are required: + * ```java + * .licenseTypeId() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseRetrieveByExternalIdParams]. */ + class Builder internal constructor() { + + private var externalLicenseId: String? = null + private var licenseTypeId: String? = null + private var subscriptionId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseRetrieveByExternalIdParams: LicenseRetrieveByExternalIdParams) = + apply { + externalLicenseId = licenseRetrieveByExternalIdParams.externalLicenseId + licenseTypeId = licenseRetrieveByExternalIdParams.licenseTypeId + subscriptionId = licenseRetrieveByExternalIdParams.subscriptionId + additionalHeaders = licenseRetrieveByExternalIdParams.additionalHeaders.toBuilder() + additionalQueryParams = + licenseRetrieveByExternalIdParams.additionalQueryParams.toBuilder() + } + + fun externalLicenseId(externalLicenseId: String?) = apply { + this.externalLicenseId = externalLicenseId + } + + /** Alias for calling [Builder.externalLicenseId] with `externalLicenseId.orElse(null)`. */ + fun externalLicenseId(externalLicenseId: Optional) = + externalLicenseId(externalLicenseId.getOrNull()) + + /** The ID of the license type to fetch the license for. */ + fun licenseTypeId(licenseTypeId: String) = apply { this.licenseTypeId = licenseTypeId } + + /** The ID of the subscription to fetch the license for. */ + fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseRetrieveByExternalIdParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .licenseTypeId() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseRetrieveByExternalIdParams = + LicenseRetrieveByExternalIdParams( + externalLicenseId, + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("subscriptionId", subscriptionId), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> externalLicenseId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + put("license_type_id", licenseTypeId) + put("subscription_id", subscriptionId) + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseRetrieveByExternalIdParams && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + subscriptionId == other.subscriptionId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + externalLicenseId, + licenseTypeId, + subscriptionId, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "LicenseRetrieveByExternalIdParams{externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, subscriptionId=$subscriptionId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdResponse.kt new file mode 100644 index 000000000..44bb63278 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdResponse.kt @@ -0,0 +1,556 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseRetrieveByExternalIdResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val endDate: JsonField, + private val externalLicenseId: JsonField, + private val licenseTypeId: JsonField, + private val startDate: JsonField, + private val status: JsonField, + private val subscriptionId: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + ) : this( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = externalLicenseId.getRequired("external_license_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): OffsetDateTime = startDate.getRequired("start_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LicenseRetrieveByExternalIdResponse]. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseRetrieveByExternalIdResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var endDate: JsonField? = null + private var externalLicenseId: JsonField? = null + private var licenseTypeId: JsonField? = null + private var startDate: JsonField? = null + private var status: JsonField? = null + private var subscriptionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + licenseRetrieveByExternalIdResponse: LicenseRetrieveByExternalIdResponse + ) = apply { + id = licenseRetrieveByExternalIdResponse.id + endDate = licenseRetrieveByExternalIdResponse.endDate + externalLicenseId = licenseRetrieveByExternalIdResponse.externalLicenseId + licenseTypeId = licenseRetrieveByExternalIdResponse.licenseTypeId + startDate = licenseRetrieveByExternalIdResponse.startDate + status = licenseRetrieveByExternalIdResponse.status + subscriptionId = licenseRetrieveByExternalIdResponse.subscriptionId + additionalProperties = + licenseRetrieveByExternalIdResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + fun externalLicenseId(externalLicenseId: String) = + externalLicenseId(JsonField.of(externalLicenseId)) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + fun startDate(startDate: OffsetDateTime) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscriptionId(subscriptionId: String) = subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseRetrieveByExternalIdResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseRetrieveByExternalIdResponse = + LicenseRetrieveByExternalIdResponse( + checkRequired("id", id), + checkRequired("endDate", endDate), + checkRequired("externalLicenseId", externalLicenseId), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("startDate", startDate), + checkRequired("status", status), + checkRequired("subscriptionId", subscriptionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseRetrieveByExternalIdResponse = apply { + if (validated) { + return@apply + } + + id() + endDate() + externalLicenseId() + licenseTypeId() + startDate() + status().validate() + subscriptionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + class Status @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 ACTIVE = of("active") + + @JvmField val INACTIVE = of("inactive") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + INACTIVE, + } + + /** + * 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, + INACTIVE, + /** 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 + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + INACTIVE -> Known.INACTIVE + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseRetrieveByExternalIdResponse && + id == other.id && + endDate == other.endDate && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + startDate == other.startDate && + status == other.status && + subscriptionId == other.subscriptionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseRetrieveByExternalIdResponse{id=$id, endDate=$endDate, externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, startDate=$startDate, status=$status, subscriptionId=$subscriptionId, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveParams.kt new file mode 100644 index 000000000..c52fd1280 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveParams.kt @@ -0,0 +1,193 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.Params +import com.withorb.api.core.http.Headers +import com.withorb.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** This endpoint is used to fetch a license given an identifier. */ +class LicenseRetrieveParams +private constructor( + private val licenseId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun licenseId(): Optional = Optional.ofNullable(licenseId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): LicenseRetrieveParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [LicenseRetrieveParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseRetrieveParams]. */ + class Builder internal constructor() { + + private var licenseId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseRetrieveParams: LicenseRetrieveParams) = apply { + licenseId = licenseRetrieveParams.licenseId + additionalHeaders = licenseRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseRetrieveParams.additionalQueryParams.toBuilder() + } + + fun licenseId(licenseId: String?) = apply { this.licenseId = licenseId } + + /** Alias for calling [Builder.licenseId] with `licenseId.orElse(null)`. */ + fun licenseId(licenseId: Optional) = licenseId(licenseId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LicenseRetrieveParams = + LicenseRetrieveParams( + licenseId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> licenseId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseRetrieveParams && + licenseId == other.licenseId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(licenseId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LicenseRetrieveParams{licenseId=$licenseId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveResponse.kt new file mode 100644 index 000000000..1be48490b --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseRetrieveResponse.kt @@ -0,0 +1,552 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.Enum +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseRetrieveResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val endDate: JsonField, + private val externalLicenseId: JsonField, + private val licenseTypeId: JsonField, + private val startDate: JsonField, + private val status: JsonField, + private val subscriptionId: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + ) : this( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + mutableMapOf(), + ) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun endDate(): Optional = endDate.getOptional("end_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun externalLicenseId(): String = externalLicenseId.getRequired("external_license_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): OffsetDateTime = startDate.getRequired("start_date") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseRetrieveResponse]. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseRetrieveResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var endDate: JsonField? = null + private var externalLicenseId: JsonField? = null + private var licenseTypeId: JsonField? = null + private var startDate: JsonField? = null + private var status: JsonField? = null + private var subscriptionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseRetrieveResponse: LicenseRetrieveResponse) = apply { + id = licenseRetrieveResponse.id + endDate = licenseRetrieveResponse.endDate + externalLicenseId = licenseRetrieveResponse.externalLicenseId + licenseTypeId = licenseRetrieveResponse.licenseTypeId + startDate = licenseRetrieveResponse.startDate + status = licenseRetrieveResponse.status + subscriptionId = licenseRetrieveResponse.subscriptionId + additionalProperties = licenseRetrieveResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + fun externalLicenseId(externalLicenseId: String) = + externalLicenseId(JsonField.of(externalLicenseId)) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + fun startDate(startDate: OffsetDateTime) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + fun subscriptionId(subscriptionId: String) = subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseRetrieveResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .endDate() + * .externalLicenseId() + * .licenseTypeId() + * .startDate() + * .status() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseRetrieveResponse = + LicenseRetrieveResponse( + checkRequired("id", id), + checkRequired("endDate", endDate), + checkRequired("externalLicenseId", externalLicenseId), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("startDate", startDate), + checkRequired("status", status), + checkRequired("subscriptionId", subscriptionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseRetrieveResponse = apply { + if (validated) { + return@apply + } + + id() + endDate() + externalLicenseId() + licenseTypeId() + startDate() + status().validate() + subscriptionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + class Status @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 ACTIVE = of("active") + + @JvmField val INACTIVE = of("inactive") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + INACTIVE, + } + + /** + * 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, + INACTIVE, + /** 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 + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to 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 + INACTIVE -> Known.INACTIVE + else -> throw OrbInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseRetrieveResponse && + id == other.id && + endDate == other.endDate && + externalLicenseId == other.externalLicenseId && + licenseTypeId == other.licenseTypeId && + startDate == other.startDate && + status == other.status && + subscriptionId == other.subscriptionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + endDate, + externalLicenseId, + licenseTypeId, + startDate, + status, + subscriptionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseRetrieveResponse{id=$id, endDate=$endDate, externalLicenseId=$externalLicenseId, licenseTypeId=$licenseTypeId, startDate=$startDate, status=$status, subscriptionId=$subscriptionId, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeCreateParams.kt new file mode 100644 index 000000000..cc24d864f --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeCreateParams.kt @@ -0,0 +1,505 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +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 +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Collections +import java.util.Objects + +/** + * This endpoint is used to create a new license type. + * + * License types are used to group licenses and define billing behavior. Each license type has a + * name and a grouping key that determines how metrics are aggregated for billing purposes. + */ +class LicenseTypeCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The key used for grouping licenses of this type. This is typically a user identifier field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun groupingKey(): String = body.groupingKey() + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = body.name() + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _groupingKey(): JsonField = body._groupingKey() + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _name(): JsonField = body._name() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeCreateParams]. + * + * The following fields are required: + * ```java + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeCreateParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseTypeCreateParams: LicenseTypeCreateParams) = apply { + body = licenseTypeCreateParams.body.toBuilder() + additionalHeaders = licenseTypeCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseTypeCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [groupingKey] + * - [name] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + */ + fun groupingKey(groupingKey: String) = apply { body.groupingKey(groupingKey) } + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun groupingKey(groupingKey: JsonField) = apply { body.groupingKey(groupingKey) } + + /** The name of the license type. */ + fun name(name: String) = apply { body.name(name) } + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { body.name(name) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseTypeCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeCreateParams = + LicenseTypeCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(groupingKey, name, mutableMapOf()) + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Body]. + * + * The following fields are required: + * ```java + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + groupingKey = body.groupingKey + name = body.name + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Body = + Body( + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(groupingKey, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LicenseTypeCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeCreateResponse.kt new file mode 100644 index 000000000..46ff3bd95 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeCreateResponse.kt @@ -0,0 +1,259 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Collections +import java.util.Objects + +/** + * The LicenseType resource represents a type of license that can be assigned to users. License + * types are used during billing by grouping metrics on the configured grouping key. + */ +class LicenseTypeCreateResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeCreateResponse]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeCreateResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseTypeCreateResponse: LicenseTypeCreateResponse) = apply { + id = licenseTypeCreateResponse.id + groupingKey = licenseTypeCreateResponse.groupingKey + name = licenseTypeCreateResponse.name + additionalProperties = licenseTypeCreateResponse.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun groupingKey(groupingKey: JsonField) = apply { this.groupingKey = groupingKey } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseTypeCreateResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeCreateResponse = + LicenseTypeCreateResponse( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseTypeCreateResponse = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeCreateResponse && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(id, groupingKey, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseTypeCreateResponse{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPage.kt new file mode 100644 index 000000000..56cf27b4a --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPage.kt @@ -0,0 +1,136 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.AutoPager +import com.withorb.api.core.Page +import com.withorb.api.core.checkRequired +import com.withorb.api.services.blocking.LicenseTypeService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see LicenseTypeService.list */ +class LicenseTypeListPage +private constructor( + private val service: LicenseTypeService, + private val params: LicenseTypeListParams, + private val response: LicenseTypeListPageResponse, +) : Page { + + /** + * Delegates to [LicenseTypeListPageResponse], but gracefully handles missing data. + * + * @see LicenseTypeListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LicenseTypeListPageResponse], but gracefully handles missing data. + * + * @see LicenseTypeListPageResponse.paginationMetadata + */ + fun paginationMetadata(): Optional = + response._paginationMetadata().getOptional("pagination_metadata") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = + items().isNotEmpty() && + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.isPresent + + fun nextPageParams(): LicenseTypeListParams { + val nextCursor = + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): LicenseTypeListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): LicenseTypeListParams = params + + /** The response that this page was parsed from. */ + fun response(): LicenseTypeListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeListPage]. */ + class Builder internal constructor() { + + private var service: LicenseTypeService? = null + private var params: LicenseTypeListParams? = null + private var response: LicenseTypeListPageResponse? = null + + @JvmSynthetic + internal fun from(licenseTypeListPage: LicenseTypeListPage) = apply { + service = licenseTypeListPage.service + params = licenseTypeListPage.params + response = licenseTypeListPage.response + } + + fun service(service: LicenseTypeService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: LicenseTypeListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LicenseTypeListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [LicenseTypeListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeListPage = + LicenseTypeListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "LicenseTypeListPage{service=$service, params=$params, response=$response}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPageAsync.kt new file mode 100644 index 000000000..ba5b17e26 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.AutoPagerAsync +import com.withorb.api.core.PageAsync +import com.withorb.api.core.checkRequired +import com.withorb.api.services.async.LicenseTypeServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see LicenseTypeServiceAsync.list */ +class LicenseTypeListPageAsync +private constructor( + private val service: LicenseTypeServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: LicenseTypeListParams, + private val response: LicenseTypeListPageResponse, +) : PageAsync { + + /** + * Delegates to [LicenseTypeListPageResponse], but gracefully handles missing data. + * + * @see LicenseTypeListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LicenseTypeListPageResponse], but gracefully handles missing data. + * + * @see LicenseTypeListPageResponse.paginationMetadata + */ + fun paginationMetadata(): Optional = + response._paginationMetadata().getOptional("pagination_metadata") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = + items().isNotEmpty() && + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.isPresent + + fun nextPageParams(): LicenseTypeListParams { + val nextCursor = + paginationMetadata().flatMap { it._nextCursor().getOptional("next_cursor") }.getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): LicenseTypeListParams = params + + /** The response that this page was parsed from. */ + fun response(): LicenseTypeListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeListPageAsync]. */ + class Builder internal constructor() { + + private var service: LicenseTypeServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: LicenseTypeListParams? = null + private var response: LicenseTypeListPageResponse? = null + + @JvmSynthetic + internal fun from(licenseTypeListPageAsync: LicenseTypeListPageAsync) = apply { + service = licenseTypeListPageAsync.service + streamHandlerExecutor = licenseTypeListPageAsync.streamHandlerExecutor + params = licenseTypeListPageAsync.params + response = licenseTypeListPageAsync.response + } + + fun service(service: LicenseTypeServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: LicenseTypeListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LicenseTypeListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [LicenseTypeListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeListPageAsync = + LicenseTypeListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "LicenseTypeListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPageResponse.kt new file mode 100644 index 000000000..e2005620f --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListPageResponse.kt @@ -0,0 +1,239 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Collections +import java.util.Objects +import kotlin.jvm.optionals.getOrNull + +class LicenseTypeListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val paginationMetadata: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("pagination_metadata") + @ExcludeMissing + paginationMetadata: JsonField = JsonMissing.of(), + ) : this(data, paginationMetadata, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun paginationMetadata(): PaginationMetadata = + paginationMetadata.getRequired("pagination_metadata") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") + @ExcludeMissing + fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [paginationMetadata]. + * + * Unlike [paginationMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pagination_metadata") + @ExcludeMissing + fun _paginationMetadata(): JsonField = paginationMetadata + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var paginationMetadata: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseTypeListPageResponse: LicenseTypeListPageResponse) = apply { + data = licenseTypeListPageResponse.data.map { it.toMutableList() } + paginationMetadata = licenseTypeListPageResponse.paginationMetadata + additionalProperties = licenseTypeListPageResponse.additionalProperties.toMutableMap() + } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [LicenseTypeListResponse] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: LicenseTypeListResponse) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + fun paginationMetadata(paginationMetadata: PaginationMetadata) = + paginationMetadata(JsonField.of(paginationMetadata)) + + /** + * Sets [Builder.paginationMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.paginationMetadata] with a well-typed + * [PaginationMetadata] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun paginationMetadata(paginationMetadata: JsonField) = apply { + this.paginationMetadata = paginationMetadata + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseTypeListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeListPageResponse = + LicenseTypeListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("paginationMetadata", paginationMetadata), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseTypeListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + paginationMetadata().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (paginationMetadata.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeListPageResponse && + data == other.data && + paginationMetadata == other.paginationMetadata && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(data, paginationMetadata, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseTypeListPageResponse{data=$data, paginationMetadata=$paginationMetadata, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListParams.kt new file mode 100644 index 000000000..2d82ad755 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListParams.kt @@ -0,0 +1,230 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.Params +import com.withorb.api.core.http.Headers +import com.withorb.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * This endpoint returns a list of all license types configured for the account, ordered in + * ascending order by creation time. + * + * License types are used to group licenses and define billing behavior. Each license type has a + * name and a grouping key that determines how metrics are aggregated for billing purposes. + */ +class LicenseTypeListParams +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 + * initial request. + */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** The number of items to fetch. Defaults to 20. */ + fun limit(): Optional = Optional.ofNullable(limit) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): LicenseTypeListParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [LicenseTypeListParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeListParams]. */ + class Builder internal constructor() { + + private var cursor: String? = null + private var limit: Long? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseTypeListParams: LicenseTypeListParams) = apply { + cursor = licenseTypeListParams.cursor + limit = licenseTypeListParams.limit + additionalHeaders = licenseTypeListParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseTypeListParams.additionalQueryParams.toBuilder() + } + + /** + * Cursor for pagination. This can be populated by the `next_cursor` value returned from the + * initial request. + */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** The number of items to fetch. Defaults to 20. */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseTypeListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LicenseTypeListParams = + LicenseTypeListParams( + cursor, + limit, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + cursor?.let { put("cursor", it) } + limit?.let { put("limit", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeListParams && + cursor == other.cursor && + limit == other.limit && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(cursor, limit, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LicenseTypeListParams{cursor=$cursor, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListResponse.kt new file mode 100644 index 000000000..d6de93d06 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeListResponse.kt @@ -0,0 +1,259 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Collections +import java.util.Objects + +/** + * The LicenseType resource represents a type of license that can be assigned to users. License + * types are used during billing by grouping metrics on the configured grouping key. + */ +class LicenseTypeListResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeListResponse]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeListResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseTypeListResponse: LicenseTypeListResponse) = apply { + id = licenseTypeListResponse.id + groupingKey = licenseTypeListResponse.groupingKey + name = licenseTypeListResponse.name + additionalProperties = licenseTypeListResponse.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun groupingKey(groupingKey: JsonField) = apply { this.groupingKey = groupingKey } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseTypeListResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeListResponse = + LicenseTypeListResponse( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseTypeListResponse = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeListResponse && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(id, groupingKey, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseTypeListResponse{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeRetrieveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeRetrieveParams.kt new file mode 100644 index 000000000..958de0d5f --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeRetrieveParams.kt @@ -0,0 +1,202 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.Params +import com.withorb.api.core.http.Headers +import com.withorb.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * This endpoint returns a license type identified by its license_type_id. + * + * Use this endpoint to retrieve details about a specific license type, including its name and + * grouping key. + */ +class LicenseTypeRetrieveParams +private constructor( + private val licenseTypeId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun licenseTypeId(): Optional = Optional.ofNullable(licenseTypeId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): LicenseTypeRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeRetrieveParams]. */ + class Builder internal constructor() { + + private var licenseTypeId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseTypeRetrieveParams: LicenseTypeRetrieveParams) = apply { + licenseTypeId = licenseTypeRetrieveParams.licenseTypeId + additionalHeaders = licenseTypeRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseTypeRetrieveParams.additionalQueryParams.toBuilder() + } + + fun licenseTypeId(licenseTypeId: String?) = apply { this.licenseTypeId = licenseTypeId } + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseTypeRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LicenseTypeRetrieveParams = + LicenseTypeRetrieveParams( + licenseTypeId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> licenseTypeId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeRetrieveParams && + licenseTypeId == other.licenseTypeId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(licenseTypeId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LicenseTypeRetrieveParams{licenseTypeId=$licenseTypeId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeRetrieveResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeRetrieveResponse.kt new file mode 100644 index 000000000..7024ecdc0 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseTypeRetrieveResponse.kt @@ -0,0 +1,259 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkRequired +import com.withorb.api.errors.OrbInvalidDataException +import java.util.Collections +import java.util.Objects + +/** + * The LicenseType resource represents a type of license that can be assigned to users. License + * types are used during billing by grouping metrics on the configured grouping key. + */ +class LicenseTypeRetrieveResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseTypeRetrieveResponse]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseTypeRetrieveResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseTypeRetrieveResponse: LicenseTypeRetrieveResponse) = apply { + id = licenseTypeRetrieveResponse.id + groupingKey = licenseTypeRetrieveResponse.groupingKey + name = licenseTypeRetrieveResponse.name + additionalProperties = licenseTypeRetrieveResponse.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun groupingKey(groupingKey: JsonField) = apply { this.groupingKey = groupingKey } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseTypeRetrieveResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseTypeRetrieveResponse = + LicenseTypeRetrieveResponse( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseTypeRetrieveResponse = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseTypeRetrieveResponse && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(id, groupingKey, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseTypeRetrieveResponse{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageParams.kt new file mode 100644 index 000000000..941a47d15 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageParams.kt @@ -0,0 +1,341 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +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 +import com.withorb.api.core.toImmutable +import java.time.LocalDate +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Returns usage and remaining credits for all licenses of a given type on a subscription. + * + * Date range defaults to the current billing period if not specified. + */ +class LicenseUsageGetAllUsageParams +private constructor( + private val licenseTypeId: String, + private val subscriptionId: String, + private val cursor: String?, + private val endDate: LocalDate?, + private val groupBy: List?, + private val limit: Long?, + private val startDate: LocalDate?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The license type ID to filter licenses by. */ + fun licenseTypeId(): String = licenseTypeId + + /** The subscription ID to get license usage for. */ + fun subscriptionId(): String = subscriptionId + + /** Pagination cursor from a previous request. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period. */ + fun endDate(): Optional = Optional.ofNullable(endDate) + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + fun groupBy(): Optional> = Optional.ofNullable(groupBy) + + /** Maximum number of rows in the response data (default 20, max 100). */ + fun limit(): Optional = Optional.ofNullable(limit) + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing period. + */ + fun startDate(): Optional = Optional.ofNullable(startDate) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LicenseUsageGetAllUsageParams]. + * + * The following fields are required: + * ```java + * .licenseTypeId() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseUsageGetAllUsageParams]. */ + class Builder internal constructor() { + + private var licenseTypeId: String? = null + private var subscriptionId: String? = null + private var cursor: String? = null + private var endDate: LocalDate? = null + private var groupBy: MutableList? = null + private var limit: Long? = null + private var startDate: LocalDate? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseUsageGetAllUsageParams: LicenseUsageGetAllUsageParams) = apply { + licenseTypeId = licenseUsageGetAllUsageParams.licenseTypeId + subscriptionId = licenseUsageGetAllUsageParams.subscriptionId + cursor = licenseUsageGetAllUsageParams.cursor + endDate = licenseUsageGetAllUsageParams.endDate + groupBy = licenseUsageGetAllUsageParams.groupBy?.toMutableList() + limit = licenseUsageGetAllUsageParams.limit + startDate = licenseUsageGetAllUsageParams.startDate + additionalHeaders = licenseUsageGetAllUsageParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseUsageGetAllUsageParams.additionalQueryParams.toBuilder() + } + + /** The license type ID to filter licenses by. */ + fun licenseTypeId(licenseTypeId: String) = apply { this.licenseTypeId = licenseTypeId } + + /** The subscription ID to get license usage for. */ + fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId } + + /** Pagination cursor from a previous request. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** + * End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period. + */ + fun endDate(endDate: LocalDate?) = apply { this.endDate = endDate } + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + fun groupBy(groupBy: List?) = apply { this.groupBy = groupBy?.toMutableList() } + + /** Alias for calling [Builder.groupBy] with `groupBy.orElse(null)`. */ + fun groupBy(groupBy: Optional>) = groupBy(groupBy.getOrNull()) + + /** + * Adds a single [String] to [Builder.groupBy]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addGroupBy(groupBy: String) = apply { + this.groupBy = (this.groupBy ?: mutableListOf()).apply { add(groupBy) } + } + + /** Maximum number of rows in the response data (default 20, max 100). */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing + * period. + */ + fun startDate(startDate: LocalDate?) = apply { this.startDate = startDate } + + /** Alias for calling [Builder.startDate] with `startDate.orElse(null)`. */ + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseUsageGetAllUsageParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .licenseTypeId() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseUsageGetAllUsageParams = + LicenseUsageGetAllUsageParams( + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("subscriptionId", subscriptionId), + cursor, + endDate, + groupBy?.toImmutable(), + limit, + startDate, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + put("license_type_id", licenseTypeId) + put("subscription_id", subscriptionId) + cursor?.let { put("cursor", it) } + endDate?.let { put("end_date", it.toString()) } + groupBy?.forEach { put("group_by[]", it) } + limit?.let { put("limit", it.toString()) } + startDate?.let { put("start_date", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseUsageGetAllUsageParams && + licenseTypeId == other.licenseTypeId && + subscriptionId == other.subscriptionId && + cursor == other.cursor && + endDate == other.endDate && + groupBy == other.groupBy && + limit == other.limit && + startDate == other.startDate && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + licenseTypeId, + subscriptionId, + cursor, + endDate, + groupBy, + limit, + startDate, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "LicenseUsageGetAllUsageParams{licenseTypeId=$licenseTypeId, subscriptionId=$subscriptionId, cursor=$cursor, endDate=$endDate, groupBy=$groupBy, limit=$limit, startDate=$startDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageResponse.kt new file mode 100644 index 000000000..1f0c28ad8 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageResponse.kt @@ -0,0 +1,962 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.time.LocalDate +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseUsageGetAllUsageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val paginationMetadata: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(), + @JsonProperty("pagination_metadata") + @ExcludeMissing + paginationMetadata: JsonField = JsonMissing.of(), + ) : this(data, paginationMetadata, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun paginationMetadata(): PaginationMetadata = + paginationMetadata.getRequired("pagination_metadata") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [paginationMetadata]. + * + * Unlike [paginationMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pagination_metadata") + @ExcludeMissing + fun _paginationMetadata(): JsonField = paginationMetadata + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LicenseUsageGetAllUsageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseUsageGetAllUsageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var paginationMetadata: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseUsageGetAllUsageResponse: LicenseUsageGetAllUsageResponse) = + apply { + data = licenseUsageGetAllUsageResponse.data.map { it.toMutableList() } + paginationMetadata = licenseUsageGetAllUsageResponse.paginationMetadata + additionalProperties = + licenseUsageGetAllUsageResponse.additionalProperties.toMutableMap() + } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [Data] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: Data) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + fun paginationMetadata(paginationMetadata: PaginationMetadata) = + paginationMetadata(JsonField.of(paginationMetadata)) + + /** + * Sets [Builder.paginationMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.paginationMetadata] with a well-typed + * [PaginationMetadata] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun paginationMetadata(paginationMetadata: JsonField) = apply { + this.paginationMetadata = paginationMetadata + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseUsageGetAllUsageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseUsageGetAllUsageResponse = + LicenseUsageGetAllUsageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("paginationMetadata", paginationMetadata), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseUsageGetAllUsageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + paginationMetadata().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (paginationMetadata.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The LicenseUsage resource represents usage and remaining credits for a license over a date + * range. + * + * When grouped by 'day' only, license_id and external_license_id will be null as the data is + * aggregated across all licenses. + */ + class Data + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val allocatedCredits: JsonField, + private val consumedCredits: JsonField, + private val endDate: JsonField, + private val licenseTypeId: JsonField, + private val pricingUnit: JsonField, + private val remainingCredits: JsonField, + private val startDate: JsonField, + private val subscriptionId: JsonField, + private val allocationEligibleCredits: JsonField, + private val externalLicenseId: JsonField, + private val licenseId: JsonField, + private val sharedPoolCredits: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("allocated_credits") + @ExcludeMissing + allocatedCredits: JsonField = JsonMissing.of(), + @JsonProperty("consumed_credits") + @ExcludeMissing + consumedCredits: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("pricing_unit") + @ExcludeMissing + pricingUnit: JsonField = JsonMissing.of(), + @JsonProperty("remaining_credits") + @ExcludeMissing + remainingCredits: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + @JsonProperty("allocation_eligible_credits") + @ExcludeMissing + allocationEligibleCredits: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_id") + @ExcludeMissing + licenseId: JsonField = JsonMissing.of(), + @JsonProperty("shared_pool_credits") + @ExcludeMissing + sharedPoolCredits: JsonField = JsonMissing.of(), + ) : this( + allocatedCredits, + consumedCredits, + endDate, + licenseTypeId, + pricingUnit, + remainingCredits, + startDate, + subscriptionId, + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + mutableMapOf(), + ) + + /** + * The total credits allocated to this license for the period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun allocatedCredits(): Double = allocatedCredits.getRequired("allocated_credits") + + /** + * The credits consumed by this license for the period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun consumedCredits(): Double = consumedCredits.getRequired("consumed_credits") + + /** + * The end date of the usage period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun endDate(): LocalDate = endDate.getRequired("end_date") + + /** + * The unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * The pricing unit for the credits (e.g., 'credits'). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun pricingUnit(): String = pricingUnit.getRequired("pricing_unit") + + /** + * The remaining credits available for this license (allocated - consumed). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun remainingCredits(): Double = remainingCredits.getRequired("remaining_credits") + + /** + * The start date of the usage period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): LocalDate = startDate.getRequired("start_date") + + /** + * The unique identifier for the subscription. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Credits consumed while the license was active (eligible for individual allocation + * deduction). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun allocationEligibleCredits(): Optional = + allocationEligibleCredits.getOptional("allocation_eligible_credits") + + /** + * The external identifier for the license. Null when grouped by day only. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalLicenseId(): Optional = + externalLicenseId.getOptional("external_license_id") + + /** + * The unique identifier for the license. Null when grouped by day only. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseId(): Optional = licenseId.getOptional("license_id") + + /** + * Credits consumed while the license was inactive (draws from shared pool, not individual + * allocation). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sharedPoolCredits(): Optional = + sharedPoolCredits.getOptional("shared_pool_credits") + + /** + * Returns the raw JSON value of [allocatedCredits]. + * + * Unlike [allocatedCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("allocated_credits") + @ExcludeMissing + fun _allocatedCredits(): JsonField = allocatedCredits + + /** + * Returns the raw JSON value of [consumedCredits]. + * + * Unlike [consumedCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("consumed_credits") + @ExcludeMissing + fun _consumedCredits(): JsonField = consumedCredits + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [pricingUnit]. + * + * Unlike [pricingUnit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pricing_unit") + @ExcludeMissing + fun _pricingUnit(): JsonField = pricingUnit + + /** + * Returns the raw JSON value of [remainingCredits]. + * + * Unlike [remainingCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("remaining_credits") + @ExcludeMissing + fun _remainingCredits(): JsonField = remainingCredits + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + /** + * Returns the raw JSON value of [allocationEligibleCredits]. + * + * Unlike [allocationEligibleCredits], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("allocation_eligible_credits") + @ExcludeMissing + fun _allocationEligibleCredits(): JsonField = allocationEligibleCredits + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseId]. + * + * Unlike [licenseId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_id") @ExcludeMissing fun _licenseId(): JsonField = licenseId + + /** + * Returns the raw JSON value of [sharedPoolCredits]. + * + * Unlike [sharedPoolCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("shared_pool_credits") + @ExcludeMissing + fun _sharedPoolCredits(): JsonField = sharedPoolCredits + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Data]. + * + * The following fields are required: + * ```java + * .allocatedCredits() + * .consumedCredits() + * .endDate() + * .licenseTypeId() + * .pricingUnit() + * .remainingCredits() + * .startDate() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Data]. */ + class Builder internal constructor() { + + private var allocatedCredits: JsonField? = null + private var consumedCredits: JsonField? = null + private var endDate: JsonField? = null + private var licenseTypeId: JsonField? = null + private var pricingUnit: JsonField? = null + private var remainingCredits: JsonField? = null + private var startDate: JsonField? = null + private var subscriptionId: JsonField? = null + private var allocationEligibleCredits: JsonField = JsonMissing.of() + private var externalLicenseId: JsonField = JsonMissing.of() + private var licenseId: JsonField = JsonMissing.of() + private var sharedPoolCredits: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(data: Data) = apply { + allocatedCredits = data.allocatedCredits + consumedCredits = data.consumedCredits + endDate = data.endDate + licenseTypeId = data.licenseTypeId + pricingUnit = data.pricingUnit + remainingCredits = data.remainingCredits + startDate = data.startDate + subscriptionId = data.subscriptionId + allocationEligibleCredits = data.allocationEligibleCredits + externalLicenseId = data.externalLicenseId + licenseId = data.licenseId + sharedPoolCredits = data.sharedPoolCredits + additionalProperties = data.additionalProperties.toMutableMap() + } + + /** The total credits allocated to this license for the period. */ + fun allocatedCredits(allocatedCredits: Double) = + allocatedCredits(JsonField.of(allocatedCredits)) + + /** + * Sets [Builder.allocatedCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.allocatedCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun allocatedCredits(allocatedCredits: JsonField) = apply { + this.allocatedCredits = allocatedCredits + } + + /** The credits consumed by this license for the period. */ + fun consumedCredits(consumedCredits: Double) = + consumedCredits(JsonField.of(consumedCredits)) + + /** + * Sets [Builder.consumedCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.consumedCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun consumedCredits(consumedCredits: JsonField) = apply { + this.consumedCredits = consumedCredits + } + + /** The end date of the usage period. */ + fun endDate(endDate: LocalDate) = endDate(JsonField.of(endDate)) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + /** The unique identifier for the license type. */ + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + /** The pricing unit for the credits (e.g., 'credits'). */ + fun pricingUnit(pricingUnit: String) = pricingUnit(JsonField.of(pricingUnit)) + + /** + * Sets [Builder.pricingUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.pricingUnit] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pricingUnit(pricingUnit: JsonField) = apply { + this.pricingUnit = pricingUnit + } + + /** The remaining credits available for this license (allocated - consumed). */ + fun remainingCredits(remainingCredits: Double) = + remainingCredits(JsonField.of(remainingCredits)) + + /** + * Sets [Builder.remainingCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.remainingCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun remainingCredits(remainingCredits: JsonField) = apply { + this.remainingCredits = remainingCredits + } + + /** The start date of the usage period. */ + fun startDate(startDate: LocalDate) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + /** The unique identifier for the subscription. */ + fun subscriptionId(subscriptionId: String) = + subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + /** + * Credits consumed while the license was active (eligible for individual allocation + * deduction). + */ + fun allocationEligibleCredits(allocationEligibleCredits: Double?) = + allocationEligibleCredits(JsonField.ofNullable(allocationEligibleCredits)) + + /** + * Alias for [Builder.allocationEligibleCredits]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun allocationEligibleCredits(allocationEligibleCredits: Double) = + allocationEligibleCredits(allocationEligibleCredits as Double?) + + /** + * Alias for calling [Builder.allocationEligibleCredits] with + * `allocationEligibleCredits.orElse(null)`. + */ + fun allocationEligibleCredits(allocationEligibleCredits: Optional) = + allocationEligibleCredits(allocationEligibleCredits.getOrNull()) + + /** + * Sets [Builder.allocationEligibleCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.allocationEligibleCredits] with a well-typed + * [Double] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun allocationEligibleCredits(allocationEligibleCredits: JsonField) = apply { + this.allocationEligibleCredits = allocationEligibleCredits + } + + /** The external identifier for the license. Null when grouped by day only. */ + fun externalLicenseId(externalLicenseId: String?) = + externalLicenseId(JsonField.ofNullable(externalLicenseId)) + + /** + * Alias for calling [Builder.externalLicenseId] with `externalLicenseId.orElse(null)`. + */ + fun externalLicenseId(externalLicenseId: Optional) = + externalLicenseId(externalLicenseId.getOrNull()) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + /** The unique identifier for the license. Null when grouped by day only. */ + fun licenseId(licenseId: String?) = licenseId(JsonField.ofNullable(licenseId)) + + /** Alias for calling [Builder.licenseId] with `licenseId.orElse(null)`. */ + fun licenseId(licenseId: Optional) = licenseId(licenseId.getOrNull()) + + /** + * Sets [Builder.licenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseId(licenseId: JsonField) = apply { this.licenseId = licenseId } + + /** + * Credits consumed while the license was inactive (draws from shared pool, not + * individual allocation). + */ + fun sharedPoolCredits(sharedPoolCredits: Double?) = + sharedPoolCredits(JsonField.ofNullable(sharedPoolCredits)) + + /** + * Alias for [Builder.sharedPoolCredits]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun sharedPoolCredits(sharedPoolCredits: Double) = + sharedPoolCredits(sharedPoolCredits as Double?) + + /** + * Alias for calling [Builder.sharedPoolCredits] with `sharedPoolCredits.orElse(null)`. + */ + fun sharedPoolCredits(sharedPoolCredits: Optional) = + sharedPoolCredits(sharedPoolCredits.getOrNull()) + + /** + * Sets [Builder.sharedPoolCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.sharedPoolCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sharedPoolCredits(sharedPoolCredits: JsonField) = apply { + this.sharedPoolCredits = sharedPoolCredits + } + + 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) + } + + /** + * Returns an immutable instance of [Data]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .allocatedCredits() + * .consumedCredits() + * .endDate() + * .licenseTypeId() + * .pricingUnit() + * .remainingCredits() + * .startDate() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Data = + Data( + checkRequired("allocatedCredits", allocatedCredits), + checkRequired("consumedCredits", consumedCredits), + checkRequired("endDate", endDate), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("pricingUnit", pricingUnit), + checkRequired("remainingCredits", remainingCredits), + checkRequired("startDate", startDate), + checkRequired("subscriptionId", subscriptionId), + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Data = apply { + if (validated) { + return@apply + } + + allocatedCredits() + consumedCredits() + endDate() + licenseTypeId() + pricingUnit() + remainingCredits() + startDate() + subscriptionId() + allocationEligibleCredits() + externalLicenseId() + licenseId() + sharedPoolCredits() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (allocatedCredits.asKnown().isPresent) 1 else 0) + + (if (consumedCredits.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (pricingUnit.asKnown().isPresent) 1 else 0) + + (if (remainingCredits.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + (if (allocationEligibleCredits.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseId.asKnown().isPresent) 1 else 0) + + (if (sharedPoolCredits.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Data && + allocatedCredits == other.allocatedCredits && + consumedCredits == other.consumedCredits && + endDate == other.endDate && + licenseTypeId == other.licenseTypeId && + pricingUnit == other.pricingUnit && + remainingCredits == other.remainingCredits && + startDate == other.startDate && + subscriptionId == other.subscriptionId && + allocationEligibleCredits == other.allocationEligibleCredits && + externalLicenseId == other.externalLicenseId && + licenseId == other.licenseId && + sharedPoolCredits == other.sharedPoolCredits && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + allocatedCredits, + consumedCredits, + endDate, + licenseTypeId, + pricingUnit, + remainingCredits, + startDate, + subscriptionId, + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Data{allocatedCredits=$allocatedCredits, consumedCredits=$consumedCredits, endDate=$endDate, licenseTypeId=$licenseTypeId, pricingUnit=$pricingUnit, remainingCredits=$remainingCredits, startDate=$startDate, subscriptionId=$subscriptionId, allocationEligibleCredits=$allocationEligibleCredits, externalLicenseId=$externalLicenseId, licenseId=$licenseId, sharedPoolCredits=$sharedPoolCredits, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseUsageGetAllUsageResponse && + data == other.data && + paginationMetadata == other.paginationMetadata && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(data, paginationMetadata, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseUsageGetAllUsageResponse{data=$data, paginationMetadata=$paginationMetadata, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetUsageParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetUsageParams.kt new file mode 100644 index 000000000..8a1701ee0 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetUsageParams.kt @@ -0,0 +1,320 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +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 +import java.time.LocalDate +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Returns usage and remaining credits for a specific license over a date range. + * + * Date range defaults to the current billing period if not specified. + */ +class LicenseUsageGetUsageParams +private constructor( + private val licenseId: String?, + private val cursor: String?, + private val endDate: LocalDate?, + private val groupBy: List?, + private val limit: Long?, + private val startDate: LocalDate?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun licenseId(): Optional = Optional.ofNullable(licenseId) + + /** Pagination cursor from a previous request. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period. */ + fun endDate(): Optional = Optional.ofNullable(endDate) + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + fun groupBy(): Optional> = Optional.ofNullable(groupBy) + + /** Maximum number of rows in the response data (default 20, max 100). */ + fun limit(): Optional = Optional.ofNullable(limit) + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing period. + */ + fun startDate(): Optional = Optional.ofNullable(startDate) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): LicenseUsageGetUsageParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [LicenseUsageGetUsageParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseUsageGetUsageParams]. */ + class Builder internal constructor() { + + private var licenseId: String? = null + private var cursor: String? = null + private var endDate: LocalDate? = null + private var groupBy: MutableList? = null + private var limit: Long? = null + private var startDate: LocalDate? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(licenseUsageGetUsageParams: LicenseUsageGetUsageParams) = apply { + licenseId = licenseUsageGetUsageParams.licenseId + cursor = licenseUsageGetUsageParams.cursor + endDate = licenseUsageGetUsageParams.endDate + groupBy = licenseUsageGetUsageParams.groupBy?.toMutableList() + limit = licenseUsageGetUsageParams.limit + startDate = licenseUsageGetUsageParams.startDate + additionalHeaders = licenseUsageGetUsageParams.additionalHeaders.toBuilder() + additionalQueryParams = licenseUsageGetUsageParams.additionalQueryParams.toBuilder() + } + + fun licenseId(licenseId: String?) = apply { this.licenseId = licenseId } + + /** Alias for calling [Builder.licenseId] with `licenseId.orElse(null)`. */ + fun licenseId(licenseId: Optional) = licenseId(licenseId.getOrNull()) + + /** Pagination cursor from a previous request. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** + * End date for the usage period (YYYY-MM-DD). Defaults to end of current billing period. + */ + fun endDate(endDate: LocalDate?) = apply { this.endDate = endDate } + + /** Alias for calling [Builder.endDate] with `endDate.orElse(null)`. */ + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + fun groupBy(groupBy: List?) = apply { this.groupBy = groupBy?.toMutableList() } + + /** Alias for calling [Builder.groupBy] with `groupBy.orElse(null)`. */ + fun groupBy(groupBy: Optional>) = groupBy(groupBy.getOrNull()) + + /** + * Adds a single [String] to [Builder.groupBy]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addGroupBy(groupBy: String) = apply { + this.groupBy = (this.groupBy ?: mutableListOf()).apply { add(groupBy) } + } + + /** Maximum number of rows in the response data (default 20, max 100). */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current billing + * period. + */ + fun startDate(startDate: LocalDate?) = apply { this.startDate = startDate } + + /** Alias for calling [Builder.startDate] with `startDate.orElse(null)`. */ + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [LicenseUsageGetUsageParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LicenseUsageGetUsageParams = + LicenseUsageGetUsageParams( + licenseId, + cursor, + endDate, + groupBy?.toImmutable(), + limit, + startDate, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> licenseId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + cursor?.let { put("cursor", it) } + endDate?.let { put("end_date", it.toString()) } + groupBy?.forEach { put("group_by[]", it) } + limit?.let { put("limit", it.toString()) } + startDate?.let { put("start_date", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseUsageGetUsageParams && + licenseId == other.licenseId && + cursor == other.cursor && + endDate == other.endDate && + groupBy == other.groupBy && + limit == other.limit && + startDate == other.startDate && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + licenseId, + cursor, + endDate, + groupBy, + limit, + startDate, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "LicenseUsageGetUsageParams{licenseId=$licenseId, cursor=$cursor, endDate=$endDate, groupBy=$groupBy, limit=$limit, startDate=$startDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetUsageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetUsageResponse.kt new file mode 100644 index 000000000..b97547df0 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/LicenseUsageGetUsageResponse.kt @@ -0,0 +1,959 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.withorb.api.core.ExcludeMissing +import com.withorb.api.core.JsonField +import com.withorb.api.core.JsonMissing +import com.withorb.api.core.JsonValue +import com.withorb.api.core.checkKnown +import com.withorb.api.core.checkRequired +import com.withorb.api.core.toImmutable +import com.withorb.api.errors.OrbInvalidDataException +import java.time.LocalDate +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class LicenseUsageGetUsageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val paginationMetadata: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(), + @JsonProperty("pagination_metadata") + @ExcludeMissing + paginationMetadata: JsonField = JsonMissing.of(), + ) : this(data, paginationMetadata, mutableMapOf()) + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly + * missing or null (e.g. if the server responded with an unexpected value). + */ + fun paginationMetadata(): PaginationMetadata = + paginationMetadata.getRequired("pagination_metadata") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [paginationMetadata]. + * + * Unlike [paginationMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pagination_metadata") + @ExcludeMissing + fun _paginationMetadata(): JsonField = paginationMetadata + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseUsageGetUsageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseUsageGetUsageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var paginationMetadata: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseUsageGetUsageResponse: LicenseUsageGetUsageResponse) = apply { + data = licenseUsageGetUsageResponse.data.map { it.toMutableList() } + paginationMetadata = licenseUsageGetUsageResponse.paginationMetadata + additionalProperties = licenseUsageGetUsageResponse.additionalProperties.toMutableMap() + } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [Data] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: Data) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + fun paginationMetadata(paginationMetadata: PaginationMetadata) = + paginationMetadata(JsonField.of(paginationMetadata)) + + /** + * Sets [Builder.paginationMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.paginationMetadata] with a well-typed + * [PaginationMetadata] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun paginationMetadata(paginationMetadata: JsonField) = apply { + this.paginationMetadata = paginationMetadata + } + + 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) + } + + /** + * Returns an immutable instance of [LicenseUsageGetUsageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .paginationMetadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseUsageGetUsageResponse = + LicenseUsageGetUsageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("paginationMetadata", paginationMetadata), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseUsageGetUsageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + paginationMetadata().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (paginationMetadata.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The LicenseUsage resource represents usage and remaining credits for a license over a date + * range. + * + * When grouped by 'day' only, license_id and external_license_id will be null as the data is + * aggregated across all licenses. + */ + class Data + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val allocatedCredits: JsonField, + private val consumedCredits: JsonField, + private val endDate: JsonField, + private val licenseTypeId: JsonField, + private val pricingUnit: JsonField, + private val remainingCredits: JsonField, + private val startDate: JsonField, + private val subscriptionId: JsonField, + private val allocationEligibleCredits: JsonField, + private val externalLicenseId: JsonField, + private val licenseId: JsonField, + private val sharedPoolCredits: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("allocated_credits") + @ExcludeMissing + allocatedCredits: JsonField = JsonMissing.of(), + @JsonProperty("consumed_credits") + @ExcludeMissing + consumedCredits: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + endDate: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), + @JsonProperty("pricing_unit") + @ExcludeMissing + pricingUnit: JsonField = JsonMissing.of(), + @JsonProperty("remaining_credits") + @ExcludeMissing + remainingCredits: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + startDate: JsonField = JsonMissing.of(), + @JsonProperty("subscription_id") + @ExcludeMissing + subscriptionId: JsonField = JsonMissing.of(), + @JsonProperty("allocation_eligible_credits") + @ExcludeMissing + allocationEligibleCredits: JsonField = JsonMissing.of(), + @JsonProperty("external_license_id") + @ExcludeMissing + externalLicenseId: JsonField = JsonMissing.of(), + @JsonProperty("license_id") + @ExcludeMissing + licenseId: JsonField = JsonMissing.of(), + @JsonProperty("shared_pool_credits") + @ExcludeMissing + sharedPoolCredits: JsonField = JsonMissing.of(), + ) : this( + allocatedCredits, + consumedCredits, + endDate, + licenseTypeId, + pricingUnit, + remainingCredits, + startDate, + subscriptionId, + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + mutableMapOf(), + ) + + /** + * The total credits allocated to this license for the period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun allocatedCredits(): Double = allocatedCredits.getRequired("allocated_credits") + + /** + * The credits consumed by this license for the period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun consumedCredits(): Double = consumedCredits.getRequired("consumed_credits") + + /** + * The end date of the usage period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun endDate(): LocalDate = endDate.getRequired("end_date") + + /** + * The unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun licenseTypeId(): String = licenseTypeId.getRequired("license_type_id") + + /** + * The pricing unit for the credits (e.g., 'credits'). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun pricingUnit(): String = pricingUnit.getRequired("pricing_unit") + + /** + * The remaining credits available for this license (allocated - consumed). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun remainingCredits(): Double = remainingCredits.getRequired("remaining_credits") + + /** + * The start date of the usage period. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun startDate(): LocalDate = startDate.getRequired("start_date") + + /** + * The unique identifier for the subscription. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun subscriptionId(): String = subscriptionId.getRequired("subscription_id") + + /** + * Credits consumed while the license was active (eligible for individual allocation + * deduction). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun allocationEligibleCredits(): Optional = + allocationEligibleCredits.getOptional("allocation_eligible_credits") + + /** + * The external identifier for the license. Null when grouped by day only. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalLicenseId(): Optional = + externalLicenseId.getOptional("external_license_id") + + /** + * The unique identifier for the license. Null when grouped by day only. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseId(): Optional = licenseId.getOptional("license_id") + + /** + * Credits consumed while the license was inactive (draws from shared pool, not individual + * allocation). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sharedPoolCredits(): Optional = + sharedPoolCredits.getOptional("shared_pool_credits") + + /** + * Returns the raw JSON value of [allocatedCredits]. + * + * Unlike [allocatedCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("allocated_credits") + @ExcludeMissing + fun _allocatedCredits(): JsonField = allocatedCredits + + /** + * Returns the raw JSON value of [consumedCredits]. + * + * Unlike [consumedCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("consumed_credits") + @ExcludeMissing + fun _consumedCredits(): JsonField = consumedCredits + + /** + * Returns the raw JSON value of [endDate]. + * + * Unlike [endDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField = endDate + + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + + /** + * Returns the raw JSON value of [pricingUnit]. + * + * Unlike [pricingUnit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pricing_unit") + @ExcludeMissing + fun _pricingUnit(): JsonField = pricingUnit + + /** + * Returns the raw JSON value of [remainingCredits]. + * + * Unlike [remainingCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("remaining_credits") + @ExcludeMissing + fun _remainingCredits(): JsonField = remainingCredits + + /** + * Returns the raw JSON value of [startDate]. + * + * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("start_date") + @ExcludeMissing + fun _startDate(): JsonField = startDate + + /** + * Returns the raw JSON value of [subscriptionId]. + * + * Unlike [subscriptionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("subscription_id") + @ExcludeMissing + fun _subscriptionId(): JsonField = subscriptionId + + /** + * Returns the raw JSON value of [allocationEligibleCredits]. + * + * Unlike [allocationEligibleCredits], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("allocation_eligible_credits") + @ExcludeMissing + fun _allocationEligibleCredits(): JsonField = allocationEligibleCredits + + /** + * Returns the raw JSON value of [externalLicenseId]. + * + * Unlike [externalLicenseId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_license_id") + @ExcludeMissing + fun _externalLicenseId(): JsonField = externalLicenseId + + /** + * Returns the raw JSON value of [licenseId]. + * + * Unlike [licenseId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_id") @ExcludeMissing fun _licenseId(): JsonField = licenseId + + /** + * Returns the raw JSON value of [sharedPoolCredits]. + * + * Unlike [sharedPoolCredits], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("shared_pool_credits") + @ExcludeMissing + fun _sharedPoolCredits(): JsonField = sharedPoolCredits + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Data]. + * + * The following fields are required: + * ```java + * .allocatedCredits() + * .consumedCredits() + * .endDate() + * .licenseTypeId() + * .pricingUnit() + * .remainingCredits() + * .startDate() + * .subscriptionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Data]. */ + class Builder internal constructor() { + + private var allocatedCredits: JsonField? = null + private var consumedCredits: JsonField? = null + private var endDate: JsonField? = null + private var licenseTypeId: JsonField? = null + private var pricingUnit: JsonField? = null + private var remainingCredits: JsonField? = null + private var startDate: JsonField? = null + private var subscriptionId: JsonField? = null + private var allocationEligibleCredits: JsonField = JsonMissing.of() + private var externalLicenseId: JsonField = JsonMissing.of() + private var licenseId: JsonField = JsonMissing.of() + private var sharedPoolCredits: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(data: Data) = apply { + allocatedCredits = data.allocatedCredits + consumedCredits = data.consumedCredits + endDate = data.endDate + licenseTypeId = data.licenseTypeId + pricingUnit = data.pricingUnit + remainingCredits = data.remainingCredits + startDate = data.startDate + subscriptionId = data.subscriptionId + allocationEligibleCredits = data.allocationEligibleCredits + externalLicenseId = data.externalLicenseId + licenseId = data.licenseId + sharedPoolCredits = data.sharedPoolCredits + additionalProperties = data.additionalProperties.toMutableMap() + } + + /** The total credits allocated to this license for the period. */ + fun allocatedCredits(allocatedCredits: Double) = + allocatedCredits(JsonField.of(allocatedCredits)) + + /** + * Sets [Builder.allocatedCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.allocatedCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun allocatedCredits(allocatedCredits: JsonField) = apply { + this.allocatedCredits = allocatedCredits + } + + /** The credits consumed by this license for the period. */ + fun consumedCredits(consumedCredits: Double) = + consumedCredits(JsonField.of(consumedCredits)) + + /** + * Sets [Builder.consumedCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.consumedCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun consumedCredits(consumedCredits: JsonField) = apply { + this.consumedCredits = consumedCredits + } + + /** The end date of the usage period. */ + fun endDate(endDate: LocalDate) = endDate(JsonField.of(endDate)) + + /** + * Sets [Builder.endDate] to an arbitrary JSON value. + * + * You should usually call [Builder.endDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + + /** The unique identifier for the license type. */ + fun licenseTypeId(licenseTypeId: String) = licenseTypeId(JsonField.of(licenseTypeId)) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + + /** The pricing unit for the credits (e.g., 'credits'). */ + fun pricingUnit(pricingUnit: String) = pricingUnit(JsonField.of(pricingUnit)) + + /** + * Sets [Builder.pricingUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.pricingUnit] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pricingUnit(pricingUnit: JsonField) = apply { + this.pricingUnit = pricingUnit + } + + /** The remaining credits available for this license (allocated - consumed). */ + fun remainingCredits(remainingCredits: Double) = + remainingCredits(JsonField.of(remainingCredits)) + + /** + * Sets [Builder.remainingCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.remainingCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun remainingCredits(remainingCredits: JsonField) = apply { + this.remainingCredits = remainingCredits + } + + /** The start date of the usage period. */ + fun startDate(startDate: LocalDate) = startDate(JsonField.of(startDate)) + + /** + * Sets [Builder.startDate] to an arbitrary JSON value. + * + * You should usually call [Builder.startDate] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + /** The unique identifier for the subscription. */ + fun subscriptionId(subscriptionId: String) = + subscriptionId(JsonField.of(subscriptionId)) + + /** + * Sets [Builder.subscriptionId] to an arbitrary JSON value. + * + * You should usually call [Builder.subscriptionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun subscriptionId(subscriptionId: JsonField) = apply { + this.subscriptionId = subscriptionId + } + + /** + * Credits consumed while the license was active (eligible for individual allocation + * deduction). + */ + fun allocationEligibleCredits(allocationEligibleCredits: Double?) = + allocationEligibleCredits(JsonField.ofNullable(allocationEligibleCredits)) + + /** + * Alias for [Builder.allocationEligibleCredits]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun allocationEligibleCredits(allocationEligibleCredits: Double) = + allocationEligibleCredits(allocationEligibleCredits as Double?) + + /** + * Alias for calling [Builder.allocationEligibleCredits] with + * `allocationEligibleCredits.orElse(null)`. + */ + fun allocationEligibleCredits(allocationEligibleCredits: Optional) = + allocationEligibleCredits(allocationEligibleCredits.getOrNull()) + + /** + * Sets [Builder.allocationEligibleCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.allocationEligibleCredits] with a well-typed + * [Double] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun allocationEligibleCredits(allocationEligibleCredits: JsonField) = apply { + this.allocationEligibleCredits = allocationEligibleCredits + } + + /** The external identifier for the license. Null when grouped by day only. */ + fun externalLicenseId(externalLicenseId: String?) = + externalLicenseId(JsonField.ofNullable(externalLicenseId)) + + /** + * Alias for calling [Builder.externalLicenseId] with `externalLicenseId.orElse(null)`. + */ + fun externalLicenseId(externalLicenseId: Optional) = + externalLicenseId(externalLicenseId.getOrNull()) + + /** + * Sets [Builder.externalLicenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalLicenseId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalLicenseId(externalLicenseId: JsonField) = apply { + this.externalLicenseId = externalLicenseId + } + + /** The unique identifier for the license. Null when grouped by day only. */ + fun licenseId(licenseId: String?) = licenseId(JsonField.ofNullable(licenseId)) + + /** Alias for calling [Builder.licenseId] with `licenseId.orElse(null)`. */ + fun licenseId(licenseId: Optional) = licenseId(licenseId.getOrNull()) + + /** + * Sets [Builder.licenseId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseId(licenseId: JsonField) = apply { this.licenseId = licenseId } + + /** + * Credits consumed while the license was inactive (draws from shared pool, not + * individual allocation). + */ + fun sharedPoolCredits(sharedPoolCredits: Double?) = + sharedPoolCredits(JsonField.ofNullable(sharedPoolCredits)) + + /** + * Alias for [Builder.sharedPoolCredits]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun sharedPoolCredits(sharedPoolCredits: Double) = + sharedPoolCredits(sharedPoolCredits as Double?) + + /** + * Alias for calling [Builder.sharedPoolCredits] with `sharedPoolCredits.orElse(null)`. + */ + fun sharedPoolCredits(sharedPoolCredits: Optional) = + sharedPoolCredits(sharedPoolCredits.getOrNull()) + + /** + * Sets [Builder.sharedPoolCredits] to an arbitrary JSON value. + * + * You should usually call [Builder.sharedPoolCredits] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sharedPoolCredits(sharedPoolCredits: JsonField) = apply { + this.sharedPoolCredits = sharedPoolCredits + } + + 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) + } + + /** + * Returns an immutable instance of [Data]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .allocatedCredits() + * .consumedCredits() + * .endDate() + * .licenseTypeId() + * .pricingUnit() + * .remainingCredits() + * .startDate() + * .subscriptionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Data = + Data( + checkRequired("allocatedCredits", allocatedCredits), + checkRequired("consumedCredits", consumedCredits), + checkRequired("endDate", endDate), + checkRequired("licenseTypeId", licenseTypeId), + checkRequired("pricingUnit", pricingUnit), + checkRequired("remainingCredits", remainingCredits), + checkRequired("startDate", startDate), + checkRequired("subscriptionId", subscriptionId), + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Data = apply { + if (validated) { + return@apply + } + + allocatedCredits() + consumedCredits() + endDate() + licenseTypeId() + pricingUnit() + remainingCredits() + startDate() + subscriptionId() + allocationEligibleCredits() + externalLicenseId() + licenseId() + sharedPoolCredits() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (allocatedCredits.asKnown().isPresent) 1 else 0) + + (if (consumedCredits.asKnown().isPresent) 1 else 0) + + (if (endDate.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + + (if (pricingUnit.asKnown().isPresent) 1 else 0) + + (if (remainingCredits.asKnown().isPresent) 1 else 0) + + (if (startDate.asKnown().isPresent) 1 else 0) + + (if (subscriptionId.asKnown().isPresent) 1 else 0) + + (if (allocationEligibleCredits.asKnown().isPresent) 1 else 0) + + (if (externalLicenseId.asKnown().isPresent) 1 else 0) + + (if (licenseId.asKnown().isPresent) 1 else 0) + + (if (sharedPoolCredits.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Data && + allocatedCredits == other.allocatedCredits && + consumedCredits == other.consumedCredits && + endDate == other.endDate && + licenseTypeId == other.licenseTypeId && + pricingUnit == other.pricingUnit && + remainingCredits == other.remainingCredits && + startDate == other.startDate && + subscriptionId == other.subscriptionId && + allocationEligibleCredits == other.allocationEligibleCredits && + externalLicenseId == other.externalLicenseId && + licenseId == other.licenseId && + sharedPoolCredits == other.sharedPoolCredits && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + allocatedCredits, + consumedCredits, + endDate, + licenseTypeId, + pricingUnit, + remainingCredits, + startDate, + subscriptionId, + allocationEligibleCredits, + externalLicenseId, + licenseId, + sharedPoolCredits, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Data{allocatedCredits=$allocatedCredits, consumedCredits=$consumedCredits, endDate=$endDate, licenseTypeId=$licenseTypeId, pricingUnit=$pricingUnit, remainingCredits=$remainingCredits, startDate=$startDate, subscriptionId=$subscriptionId, allocationEligibleCredits=$allocationEligibleCredits, externalLicenseId=$externalLicenseId, licenseId=$licenseId, sharedPoolCredits=$sharedPoolCredits, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseUsageGetUsageResponse && + data == other.data && + paginationMetadata == other.paginationMetadata && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(data, paginationMetadata, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseUsageGetUsageResponse{data=$data, paginationMetadata=$paginationMetadata, additionalProperties=$additionalProperties}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewAllocationPrice.kt index f2b06e1c5..5c520c742 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewAllocationPrice.kt @@ -30,6 +30,7 @@ private constructor( private val expiresAtEndOfCadence: JsonField, private val filters: JsonField>, private val itemId: JsonField, + private val licenseTypeId: JsonField, private val perUnitCostBasis: JsonField, private val additionalProperties: MutableMap, ) { @@ -49,6 +50,9 @@ private constructor( @ExcludeMissing filters: JsonField> = JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing itemId: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("per_unit_cost_basis") @ExcludeMissing perUnitCostBasis: JsonField = JsonMissing.of(), @@ -60,6 +64,7 @@ private constructor( expiresAtEndOfCadence, filters, itemId, + licenseTypeId, perUnitCostBasis, mutableMapOf(), ) @@ -125,6 +130,14 @@ private constructor( */ fun itemId(): Optional = itemId.getOptional("item_id") + /** + * The license type ID to associate the price with license allocation. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * The (per-unit) cost basis of each created block. If non-zero, a customer will be invoiced * according to the quantity and per unit cost basis specified for the allocation each cadence. @@ -189,6 +202,15 @@ private constructor( */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [perUnitCostBasis]. * @@ -236,6 +258,7 @@ private constructor( private var expiresAtEndOfCadence: JsonField = JsonMissing.of() private var filters: JsonField>? = null private var itemId: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var perUnitCostBasis: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -248,6 +271,7 @@ private constructor( expiresAtEndOfCadence = newAllocationPrice.expiresAtEndOfCadence filters = newAllocationPrice.filters.map { it.toMutableList() } itemId = newAllocationPrice.itemId + licenseTypeId = newAllocationPrice.licenseTypeId perUnitCostBasis = newAllocationPrice.perUnitCostBasis additionalProperties = newAllocationPrice.additionalProperties.toMutableMap() } @@ -387,6 +411,25 @@ private constructor( */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + /** The license type ID to associate the price with license allocation. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * The (per-unit) cost basis of each created block. If non-zero, a customer will be invoiced * according to the quantity and per unit cost basis specified for the allocation each @@ -448,6 +491,7 @@ private constructor( expiresAtEndOfCadence, (filters ?: JsonMissing.of()).map { it.toImmutable() }, itemId, + licenseTypeId, perUnitCostBasis, additionalProperties.toMutableMap(), ) @@ -467,6 +511,7 @@ private constructor( expiresAtEndOfCadence() filters().ifPresent { it.forEach { it.validate() } } itemId() + licenseTypeId() perUnitCostBasis() validated = true } @@ -493,6 +538,7 @@ private constructor( (if (expiresAtEndOfCadence.asKnown().isPresent) 1 else 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (itemId.asKnown().isPresent) 1 else 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (if (perUnitCostBasis.asKnown().isPresent) 1 else 0) /** The cadence at which to allocate the amount to the customer. */ @@ -1158,6 +1204,7 @@ private constructor( expiresAtEndOfCadence == other.expiresAtEndOfCadence && filters == other.filters && itemId == other.itemId && + licenseTypeId == other.licenseTypeId && perUnitCostBasis == other.perUnitCostBasis && additionalProperties == other.additionalProperties } @@ -1171,6 +1218,7 @@ private constructor( expiresAtEndOfCadence, filters, itemId, + licenseTypeId, perUnitCostBasis, additionalProperties, ) @@ -1179,5 +1227,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewAllocationPrice{amount=$amount, cadence=$cadence, currency=$currency, customExpiration=$customExpiration, expiresAtEndOfCadence=$expiresAtEndOfCadence, filters=$filters, itemId=$itemId, perUnitCostBasis=$perUnitCostBasis, additionalProperties=$additionalProperties}" + "NewAllocationPrice{amount=$amount, cadence=$cadence, currency=$currency, customExpiration=$customExpiration, expiresAtEndOfCadence=$expiresAtEndOfCadence, filters=$filters, itemId=$itemId, licenseTypeId=$licenseTypeId, perUnitCostBasis=$perUnitCostBasis, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkPrice.kt index 1aaa47b7c..05d215672 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( bulkConfig, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -243,6 +248,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -397,6 +410,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -456,6 +478,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -477,6 +500,7 @@ private constructor( fixedPriceQuantity = newFloatingBulkPrice.fixedPriceQuantity invoiceGroupingKey = newFloatingBulkPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingBulkPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingBulkPrice.licenseTypeId metadata = newFloatingBulkPrice.metadata additionalProperties = newFloatingBulkPrice.additionalProperties.toMutableMap() } @@ -832,6 +856,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -905,6 +948,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -933,6 +977,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -968,6 +1013,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1366,6 +1412,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1388,6 +1435,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1396,5 +1444,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingBulkPrice{bulkConfig=$bulkConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingBulkPrice{bulkConfig=$bulkConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPrice.kt index 2f1da6385..ff28636db 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( bulkWithProrationConfig, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -400,6 +413,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -460,6 +482,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -485,6 +508,7 @@ private constructor( invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingBulkWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingBulkWithProrationPrice.licenseTypeId metadata = newFloatingBulkWithProrationPrice.metadata additionalProperties = newFloatingBulkWithProrationPrice.additionalProperties.toMutableMap() @@ -845,6 +869,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -918,6 +961,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -946,6 +990,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -981,6 +1026,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** Configuration for bulk_with_proration pricing */ @@ -1779,6 +1825,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1801,6 +1848,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1809,5 +1857,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPrice.kt index 403783eed..1e42779c2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -461,6 +483,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -488,6 +511,7 @@ private constructor( invoiceGroupingKey = newFloatingCumulativeGroupedBulkPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingCumulativeGroupedBulkPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingCumulativeGroupedBulkPrice.licenseTypeId metadata = newFloatingCumulativeGroupedBulkPrice.metadata additionalProperties = newFloatingCumulativeGroupedBulkPrice.additionalProperties.toMutableMap() @@ -847,6 +871,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -920,6 +963,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -948,6 +992,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -983,6 +1028,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1869,6 +1915,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1891,6 +1938,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1899,5 +1947,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingCumulativeGroupedBulkPrice{cadence=$cadence, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingCumulativeGroupedBulkPrice{cadence=$cadence, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPrice.kt index a508400bb..a0a3185d9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -244,6 +249,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -399,6 +412,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -459,6 +481,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -484,6 +507,7 @@ private constructor( invoiceGroupingKey = newFloatingGroupedAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingGroupedAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingGroupedAllocationPrice.licenseTypeId metadata = newFloatingGroupedAllocationPrice.metadata additionalProperties = newFloatingGroupedAllocationPrice.additionalProperties.toMutableMap() @@ -844,6 +868,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -917,6 +960,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -945,6 +989,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -980,6 +1025,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1634,6 +1680,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1656,6 +1703,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1664,5 +1712,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedAllocationPrice{cadence=$cadence, currency=$currency, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedAllocationPrice{cadence=$cadence, currency=$currency, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePrice.kt index e1cd91b42..277c98efb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -461,6 +483,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -488,6 +511,7 @@ private constructor( invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newFloatingGroupedTieredPackagePrice.licenseTypeId metadata = newFloatingGroupedTieredPackagePrice.metadata additionalProperties = newFloatingGroupedTieredPackagePrice.additionalProperties.toMutableMap() @@ -847,6 +871,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -920,6 +963,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -948,6 +992,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -983,6 +1028,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1861,6 +1907,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1883,6 +1930,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1891,5 +1939,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPrice.kt index c9dc4809a..eee909059 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -400,6 +413,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -460,6 +482,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -482,6 +505,7 @@ private constructor( fixedPriceQuantity = newFloatingGroupedTieredPrice.fixedPriceQuantity invoiceGroupingKey = newFloatingGroupedTieredPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingGroupedTieredPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingGroupedTieredPrice.licenseTypeId metadata = newFloatingGroupedTieredPrice.metadata additionalProperties = newFloatingGroupedTieredPrice.additionalProperties.toMutableMap() } @@ -840,6 +864,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -913,6 +956,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -941,6 +985,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -976,6 +1021,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1813,6 +1859,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1835,6 +1882,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1843,5 +1891,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedTieredPrice{cadence=$cadence, currency=$currency, groupedTieredConfig=$groupedTieredConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedTieredPrice{cadence=$cadence, currency=$currency, groupedTieredConfig=$groupedTieredConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPrice.kt index c674d7b0b..92b34cab4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -105,6 +109,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -246,6 +251,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -402,6 +415,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -463,6 +485,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -490,6 +513,7 @@ private constructor( invoiceGroupingKey = newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingGroupedWithMeteredMinimumPrice.licenseTypeId metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata additionalProperties = newFloatingGroupedWithMeteredMinimumPrice.additionalProperties.toMutableMap() @@ -850,6 +874,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -923,6 +966,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -951,6 +995,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -986,6 +1031,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -2252,6 +2298,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -2274,6 +2321,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -2282,5 +2330,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedWithMeteredMinimumPrice{cadence=$cadence, currency=$currency, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPrice.kt index d22b0af45..54b46cba4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -462,6 +484,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -489,6 +512,7 @@ private constructor( invoiceGroupingKey = newFloatingGroupedWithProratedMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingGroupedWithProratedMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingGroupedWithProratedMinimumPrice.licenseTypeId metadata = newFloatingGroupedWithProratedMinimumPrice.metadata additionalProperties = newFloatingGroupedWithProratedMinimumPrice.additionalProperties.toMutableMap() @@ -849,6 +873,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -922,6 +965,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -950,6 +994,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -985,6 +1030,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1632,6 +1678,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1654,6 +1701,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1662,5 +1710,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedWithProratedMinimumPrice{cadence=$cadence, currency=$currency, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixPrice.kt index f0792977e..553d63679 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -243,6 +248,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -397,6 +410,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -456,6 +478,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -477,6 +500,7 @@ private constructor( fixedPriceQuantity = newFloatingMatrixPrice.fixedPriceQuantity invoiceGroupingKey = newFloatingMatrixPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingMatrixPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingMatrixPrice.licenseTypeId metadata = newFloatingMatrixPrice.metadata additionalProperties = newFloatingMatrixPrice.additionalProperties.toMutableMap() } @@ -834,6 +858,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -907,6 +950,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -935,6 +979,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -970,6 +1015,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1368,6 +1414,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1390,6 +1437,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1398,5 +1446,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMatrixPrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixConfig=$matrixConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingMatrixPrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixConfig=$matrixConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPrice.kt index 0038970cc..0445d01d7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -244,6 +249,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -400,6 +413,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -460,6 +482,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -487,6 +510,7 @@ private constructor( invoiceGroupingKey = newFloatingMatrixWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingMatrixWithAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingMatrixWithAllocationPrice.licenseTypeId metadata = newFloatingMatrixWithAllocationPrice.metadata additionalProperties = newFloatingMatrixWithAllocationPrice.additionalProperties.toMutableMap() @@ -846,6 +870,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -919,6 +962,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -947,6 +991,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -982,6 +1027,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1380,6 +1426,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1402,6 +1449,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1410,5 +1458,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMatrixWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixWithAllocationConfig=$matrixWithAllocationConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingMatrixWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixWithAllocationConfig=$matrixWithAllocationConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePrice.kt index 027156aab..55ddec8af 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -461,6 +483,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -488,6 +511,7 @@ private constructor( invoiceGroupingKey = newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration + licenseTypeId = newFloatingMatrixWithDisplayNamePrice.licenseTypeId metadata = newFloatingMatrixWithDisplayNamePrice.metadata additionalProperties = newFloatingMatrixWithDisplayNamePrice.additionalProperties.toMutableMap() @@ -847,6 +871,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -920,6 +963,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -948,6 +992,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -983,6 +1028,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1870,6 +1916,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1892,6 +1939,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1900,5 +1948,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePrice.kt index 3cfa1d538..473a74a12 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -461,6 +483,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -488,6 +511,7 @@ private constructor( invoiceGroupingKey = newFloatingMaxGroupTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingMaxGroupTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newFloatingMaxGroupTieredPackagePrice.licenseTypeId metadata = newFloatingMaxGroupTieredPackagePrice.metadata additionalProperties = newFloatingMaxGroupTieredPackagePrice.additionalProperties.toMutableMap() @@ -847,6 +871,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -920,6 +963,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -948,6 +992,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -983,6 +1028,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1862,6 +1908,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1884,6 +1931,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1892,5 +1940,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMaxGroupTieredPackagePrice{cadence=$cadence, currency=$currency, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingMaxGroupTieredPackagePrice{cadence=$cadence, currency=$currency, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePrice.kt index 4ed974d20..43c8038a8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -244,6 +249,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -399,6 +412,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -459,6 +481,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -484,6 +507,7 @@ private constructor( invoiceGroupingKey = newFloatingMinimumCompositePrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingMinimumCompositePrice.invoicingCycleConfiguration + licenseTypeId = newFloatingMinimumCompositePrice.licenseTypeId metadata = newFloatingMinimumCompositePrice.metadata additionalProperties = newFloatingMinimumCompositePrice.additionalProperties.toMutableMap() @@ -844,6 +868,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -917,6 +960,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -945,6 +989,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -980,6 +1025,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1586,6 +1632,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1608,6 +1655,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1616,5 +1664,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMinimumCompositePrice{cadence=$cadence, currency=$currency, itemId=$itemId, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingMinimumCompositePrice{cadence=$cadence, currency=$currency, itemId=$itemId, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackagePrice.kt index fb230bd52..20c2bd01d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackagePrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -243,6 +248,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -397,6 +410,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -456,6 +478,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -477,6 +500,7 @@ private constructor( fixedPriceQuantity = newFloatingPackagePrice.fixedPriceQuantity invoiceGroupingKey = newFloatingPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingPackagePrice.invoicingCycleConfiguration + licenseTypeId = newFloatingPackagePrice.licenseTypeId metadata = newFloatingPackagePrice.metadata additionalProperties = newFloatingPackagePrice.additionalProperties.toMutableMap() } @@ -834,6 +858,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -907,6 +950,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -935,6 +979,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -970,6 +1015,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1368,6 +1414,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1390,6 +1437,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1398,5 +1446,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingPackagePrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageConfig=$packageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingPackagePrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageConfig=$packageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPrice.kt index f14ba65cf..b36be7b1a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -244,6 +249,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -400,6 +413,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -460,6 +482,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -487,6 +510,7 @@ private constructor( invoiceGroupingKey = newFloatingPackageWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingPackageWithAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingPackageWithAllocationPrice.licenseTypeId metadata = newFloatingPackageWithAllocationPrice.metadata additionalProperties = newFloatingPackageWithAllocationPrice.additionalProperties.toMutableMap() @@ -846,6 +870,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -919,6 +962,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -947,6 +991,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -982,6 +1027,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1628,6 +1674,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1650,6 +1697,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1658,5 +1706,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingPackageWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingPackageWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPrice.kt index 3f49c742f..14a85c6f9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPrice.kt @@ -40,6 +40,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -106,6 +110,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -405,6 +418,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -467,6 +489,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -497,6 +520,7 @@ private constructor( invoiceGroupingKey = newFloatingScalableMatrixWithTieredPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingScalableMatrixWithTieredPricingPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingScalableMatrixWithTieredPricingPrice.licenseTypeId metadata = newFloatingScalableMatrixWithTieredPricingPrice.metadata additionalProperties = newFloatingScalableMatrixWithTieredPricingPrice.additionalProperties.toMutableMap() @@ -862,6 +886,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -938,6 +981,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -966,6 +1010,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -1001,6 +1046,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -2226,6 +2272,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -2248,6 +2295,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -2256,5 +2304,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPrice.kt index 288ff9601..01865a608 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -105,6 +109,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -246,6 +251,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -402,6 +415,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -464,6 +486,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -493,6 +516,7 @@ private constructor( invoiceGroupingKey = newFloatingScalableMatrixWithUnitPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingScalableMatrixWithUnitPricingPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingScalableMatrixWithUnitPricingPrice.licenseTypeId metadata = newFloatingScalableMatrixWithUnitPricingPrice.metadata additionalProperties = newFloatingScalableMatrixWithUnitPricingPrice.additionalProperties.toMutableMap() @@ -853,6 +877,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -929,6 +972,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -957,6 +1001,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -992,6 +1037,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -2046,6 +2092,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -2068,6 +2115,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -2076,5 +2124,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, 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, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPrice.kt index 5d4817829..21a2952b5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -461,6 +483,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -488,6 +511,7 @@ private constructor( invoiceGroupingKey = newFloatingThresholdTotalAmountPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingThresholdTotalAmountPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingThresholdTotalAmountPrice.licenseTypeId metadata = newFloatingThresholdTotalAmountPrice.metadata additionalProperties = newFloatingThresholdTotalAmountPrice.additionalProperties.toMutableMap() @@ -847,6 +871,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -920,6 +963,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -948,6 +992,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -983,6 +1028,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1833,6 +1879,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1855,6 +1902,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1863,5 +1911,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingThresholdTotalAmountPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingThresholdTotalAmountPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackagePrice.kt index 2e0f9bb42..96d56f9e7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -400,6 +413,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -460,6 +482,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -482,6 +505,7 @@ private constructor( fixedPriceQuantity = newFloatingTieredPackagePrice.fixedPriceQuantity invoiceGroupingKey = newFloatingTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newFloatingTieredPackagePrice.licenseTypeId metadata = newFloatingTieredPackagePrice.metadata additionalProperties = newFloatingTieredPackagePrice.additionalProperties.toMutableMap() } @@ -840,6 +864,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -913,6 +956,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -941,6 +985,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -976,6 +1021,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1811,6 +1857,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1833,6 +1880,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1841,5 +1889,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredPackagePrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageConfig=$tieredPackageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredPackagePrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageConfig=$tieredPackageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPrice.kt index df8245039..4990f81b0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -105,6 +109,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -246,6 +251,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -402,6 +415,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -463,6 +485,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -490,6 +513,7 @@ private constructor( invoiceGroupingKey = newFloatingTieredPackageWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingTieredPackageWithMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingTieredPackageWithMinimumPrice.licenseTypeId metadata = newFloatingTieredPackageWithMinimumPrice.metadata additionalProperties = newFloatingTieredPackageWithMinimumPrice.additionalProperties.toMutableMap() @@ -850,6 +874,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -923,6 +966,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -951,6 +995,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -986,6 +1031,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1860,6 +1906,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1882,6 +1929,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1890,5 +1938,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredPackageWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredPackageWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPrice.kt index 803a833a7..002d841ef 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -243,6 +248,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -397,6 +410,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -456,6 +478,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -477,6 +500,7 @@ private constructor( fixedPriceQuantity = newFloatingTieredPrice.fixedPriceQuantity invoiceGroupingKey = newFloatingTieredPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingTieredPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingTieredPrice.licenseTypeId metadata = newFloatingTieredPrice.metadata additionalProperties = newFloatingTieredPrice.additionalProperties.toMutableMap() } @@ -834,6 +858,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -907,6 +950,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -935,6 +979,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -970,6 +1015,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1368,6 +1414,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1390,6 +1437,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1398,5 +1446,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredConfig=$tieredConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredConfig=$tieredConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPrice.kt index c8f1fe5b4..ee5ccfbad 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -400,6 +413,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -460,6 +482,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -485,6 +508,7 @@ private constructor( invoiceGroupingKey = newFloatingTieredWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingTieredWithMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingTieredWithMinimumPrice.licenseTypeId metadata = newFloatingTieredWithMinimumPrice.metadata additionalProperties = newFloatingTieredWithMinimumPrice.additionalProperties.toMutableMap() @@ -845,6 +869,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -918,6 +961,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -946,6 +990,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -981,6 +1026,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1901,6 +1947,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1923,6 +1970,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1931,5 +1979,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPrice.kt index bb9ebf2a4..71e4249fb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -104,6 +108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -245,6 +250,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -401,6 +414,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -461,6 +483,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -488,6 +511,7 @@ private constructor( invoiceGroupingKey = newFloatingTieredWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingTieredWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingTieredWithProrationPrice.licenseTypeId metadata = newFloatingTieredWithProrationPrice.metadata additionalProperties = newFloatingTieredWithProrationPrice.additionalProperties.toMutableMap() @@ -847,6 +871,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -920,6 +963,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -948,6 +992,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -983,6 +1028,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1782,6 +1828,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1804,6 +1851,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1812,5 +1860,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitPrice.kt index 75607f1db..b29348278 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -243,6 +248,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -397,6 +410,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -456,6 +478,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -477,6 +500,7 @@ private constructor( fixedPriceQuantity = newFloatingUnitPrice.fixedPriceQuantity invoiceGroupingKey = newFloatingUnitPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingUnitPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingUnitPrice.licenseTypeId metadata = newFloatingUnitPrice.metadata additionalProperties = newFloatingUnitPrice.additionalProperties.toMutableMap() } @@ -832,6 +856,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -905,6 +948,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -933,6 +977,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -968,6 +1013,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1366,6 +1412,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1388,6 +1435,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1396,5 +1444,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitConfig=$unitConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitConfig=$unitConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPrice.kt index 4a85f81d1..af7e17d34 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -244,6 +249,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -399,6 +412,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -459,6 +481,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -484,6 +507,7 @@ private constructor( invoiceGroupingKey = newFloatingUnitWithPercentPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingUnitWithPercentPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingUnitWithPercentPrice.licenseTypeId metadata = newFloatingUnitWithPercentPrice.metadata additionalProperties = newFloatingUnitWithPercentPrice.additionalProperties.toMutableMap() @@ -843,6 +867,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -916,6 +959,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -944,6 +988,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -979,6 +1024,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1582,6 +1628,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1604,6 +1651,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1612,5 +1660,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitWithPercentPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitWithPercentPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPrice.kt index a46c6e1d9..fcf2202af 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -85,6 +86,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), ) : this( cadence, @@ -103,6 +107,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -244,6 +249,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -399,6 +412,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -459,6 +481,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -484,6 +507,7 @@ private constructor( invoiceGroupingKey = newFloatingUnitWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newFloatingUnitWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newFloatingUnitWithProrationPrice.licenseTypeId metadata = newFloatingUnitWithProrationPrice.metadata additionalProperties = newFloatingUnitWithProrationPrice.additionalProperties.toMutableMap() @@ -844,6 +868,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -917,6 +960,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -945,6 +989,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -980,6 +1025,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -1542,6 +1588,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -1564,6 +1611,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -1572,5 +1620,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkPrice.kt index 8960972a1..83d81cc78 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newPlanBulkPrice.fixedPriceQuantity invoiceGroupingKey = newPlanBulkPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanBulkPrice.invoicingCycleConfiguration + licenseTypeId = newPlanBulkPrice.licenseTypeId metadata = newPlanBulkPrice.metadata referenceId = newPlanBulkPrice.referenceId additionalProperties = newPlanBulkPrice.additionalProperties.toMutableMap() @@ -863,6 +887,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -953,6 +996,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -982,6 +1026,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1018,6 +1063,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1417,6 +1463,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1440,6 +1487,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1449,5 +1497,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanBulkPrice{bulkConfig=$bulkConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanBulkPrice{bulkConfig=$bulkConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPrice.kt index bebc0f4b7..110d54a55 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -506,6 +529,7 @@ private constructor( fixedPriceQuantity = newPlanBulkWithProrationPrice.fixedPriceQuantity invoiceGroupingKey = newPlanBulkWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanBulkWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newPlanBulkWithProrationPrice.licenseTypeId metadata = newPlanBulkWithProrationPrice.metadata referenceId = newPlanBulkWithProrationPrice.referenceId additionalProperties = newPlanBulkWithProrationPrice.additionalProperties.toMutableMap() @@ -872,6 +896,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -962,6 +1005,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -991,6 +1035,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1027,6 +1072,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1826,6 +1872,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1849,6 +1896,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1858,5 +1906,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPrice.kt index 2c6298670..2b8fcce28 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newPlanCumulativeGroupedBulkPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanCumulativeGroupedBulkPrice.invoicingCycleConfiguration + licenseTypeId = newPlanCumulativeGroupedBulkPrice.licenseTypeId metadata = newPlanCumulativeGroupedBulkPrice.metadata referenceId = newPlanCumulativeGroupedBulkPrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1919,6 +1965,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1942,6 +1989,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1951,5 +1999,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanCumulativeGroupedBulkPrice{cadence=$cadence, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanCumulativeGroupedBulkPrice{cadence=$cadence, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPrice.kt index 5038dd58b..426100a29 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -505,6 +528,7 @@ private constructor( fixedPriceQuantity = newPlanGroupedAllocationPrice.fixedPriceQuantity invoiceGroupingKey = newPlanGroupedAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanGroupedAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newPlanGroupedAllocationPrice.licenseTypeId metadata = newPlanGroupedAllocationPrice.metadata referenceId = newPlanGroupedAllocationPrice.referenceId additionalProperties = newPlanGroupedAllocationPrice.additionalProperties.toMutableMap() @@ -871,6 +895,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -961,6 +1004,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -990,6 +1034,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1026,6 +1071,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1681,6 +1727,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1704,6 +1751,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1713,5 +1761,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanGroupedAllocationPrice{cadence=$cadence, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanGroupedAllocationPrice{cadence=$cadence, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePrice.kt index eff28004e..04476c22a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newPlanGroupedTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanGroupedTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newPlanGroupedTieredPackagePrice.licenseTypeId metadata = newPlanGroupedTieredPackagePrice.metadata referenceId = newPlanGroupedTieredPackagePrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1911,6 +1957,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1934,6 +1981,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1943,5 +1991,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanGroupedTieredPackagePrice{cadence=$cadence, groupedTieredPackageConfig=$groupedTieredPackageConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPrice.kt index 908dc8d42..2e76b8bdf 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedTieredPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -504,6 +527,7 @@ private constructor( fixedPriceQuantity = newPlanGroupedTieredPrice.fixedPriceQuantity invoiceGroupingKey = newPlanGroupedTieredPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanGroupedTieredPrice.invoicingCycleConfiguration + licenseTypeId = newPlanGroupedTieredPrice.licenseTypeId metadata = newPlanGroupedTieredPrice.metadata referenceId = newPlanGroupedTieredPrice.referenceId additionalProperties = newPlanGroupedTieredPrice.additionalProperties.toMutableMap() @@ -869,6 +893,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -959,6 +1002,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -988,6 +1032,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1024,6 +1069,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1862,6 +1908,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1885,6 +1932,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1894,5 +1942,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanGroupedTieredPrice{cadence=$cadence, groupedTieredConfig=$groupedTieredConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanGroupedTieredPrice{cadence=$cadence, groupedTieredConfig=$groupedTieredConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPrice.kt index 0c06163b4..37bb160d0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -109,6 +113,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -252,6 +257,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -417,6 +430,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -486,6 +508,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -514,6 +537,7 @@ private constructor( invoiceGroupingKey = newPlanGroupedWithMeteredMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newPlanGroupedWithMeteredMinimumPrice.licenseTypeId metadata = newPlanGroupedWithMeteredMinimumPrice.metadata referenceId = newPlanGroupedWithMeteredMinimumPrice.referenceId additionalProperties = @@ -881,6 +905,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -971,6 +1014,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1000,6 +1044,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1036,6 +1081,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -2303,6 +2349,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -2326,6 +2373,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -2335,5 +2383,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanGroupedWithMeteredMinimumPrice{cadence=$cadence, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanGroupedWithMeteredMinimumPrice{cadence=$cadence, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPrice.kt index cc44542c7..8edfc0499 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -485,6 +507,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -513,6 +536,7 @@ private constructor( invoiceGroupingKey = newPlanGroupedWithProratedMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanGroupedWithProratedMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newPlanGroupedWithProratedMinimumPrice.licenseTypeId metadata = newPlanGroupedWithProratedMinimumPrice.metadata referenceId = newPlanGroupedWithProratedMinimumPrice.referenceId additionalProperties = @@ -880,6 +904,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -970,6 +1013,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -999,6 +1043,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1035,6 +1080,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1683,6 +1729,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1706,6 +1753,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1715,5 +1763,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanGroupedWithProratedMinimumPrice{cadence=$cadence, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanGroupedWithProratedMinimumPrice{cadence=$cadence, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixPrice.kt index 1fdfa4ccb..034a9fc5d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newPlanMatrixPrice.fixedPriceQuantity invoiceGroupingKey = newPlanMatrixPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanMatrixPrice.invoicingCycleConfiguration + licenseTypeId = newPlanMatrixPrice.licenseTypeId metadata = newPlanMatrixPrice.metadata referenceId = newPlanMatrixPrice.referenceId additionalProperties = newPlanMatrixPrice.additionalProperties.toMutableMap() @@ -865,6 +889,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -955,6 +998,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -984,6 +1028,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1020,6 +1065,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1419,6 +1465,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1442,6 +1489,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1451,5 +1499,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanMatrixPrice{cadence=$cadence, itemId=$itemId, matrixConfig=$matrixConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanMatrixPrice{cadence=$cadence, itemId=$itemId, matrixConfig=$matrixConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPrice.kt index c501222cb..0ee980dc4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -510,6 +533,7 @@ private constructor( invoiceGroupingKey = newPlanMatrixWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanMatrixWithAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newPlanMatrixWithAllocationPrice.licenseTypeId metadata = newPlanMatrixWithAllocationPrice.metadata referenceId = newPlanMatrixWithAllocationPrice.referenceId additionalProperties = @@ -876,6 +900,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -966,6 +1009,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -995,6 +1039,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1031,6 +1076,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1430,6 +1476,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1453,6 +1500,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1462,5 +1510,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanMatrixWithAllocationPrice{cadence=$cadence, itemId=$itemId, matrixWithAllocationConfig=$matrixWithAllocationConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanMatrixWithAllocationPrice{cadence=$cadence, itemId=$itemId, matrixWithAllocationConfig=$matrixWithAllocationConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePrice.kt index 3d27388c6..94efb23da 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newPlanMatrixWithDisplayNamePrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanMatrixWithDisplayNamePrice.invoicingCycleConfiguration + licenseTypeId = newPlanMatrixWithDisplayNamePrice.licenseTypeId metadata = newPlanMatrixWithDisplayNamePrice.metadata referenceId = newPlanMatrixWithDisplayNamePrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1920,6 +1966,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1943,6 +1990,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1952,5 +2000,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanMatrixWithDisplayNamePrice{cadence=$cadence, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePrice.kt index d213396f0..ffda2eceb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newPlanMaxGroupTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanMaxGroupTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newPlanMaxGroupTieredPackagePrice.licenseTypeId metadata = newPlanMaxGroupTieredPackagePrice.metadata referenceId = newPlanMaxGroupTieredPackagePrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1912,6 +1958,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1935,6 +1982,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1944,5 +1992,5 @@ private constructor( 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, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanMaxGroupTieredPackagePrice{cadence=$cadence, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMinimumCompositePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMinimumCompositePrice.kt index 0ec463b42..9a9012bcd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMinimumCompositePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanMinimumCompositePrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -481,6 +503,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -504,6 +527,7 @@ private constructor( fixedPriceQuantity = newPlanMinimumCompositePrice.fixedPriceQuantity invoiceGroupingKey = newPlanMinimumCompositePrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanMinimumCompositePrice.invoicingCycleConfiguration + licenseTypeId = newPlanMinimumCompositePrice.licenseTypeId metadata = newPlanMinimumCompositePrice.metadata referenceId = newPlanMinimumCompositePrice.referenceId additionalProperties = newPlanMinimumCompositePrice.additionalProperties.toMutableMap() @@ -870,6 +894,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -960,6 +1003,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -989,6 +1033,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1025,6 +1070,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1632,6 +1678,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1655,6 +1702,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1664,5 +1712,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanMinimumCompositePrice{cadence=$cadence, itemId=$itemId, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanMinimumCompositePrice{cadence=$cadence, itemId=$itemId, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackagePrice.kt index 2ba731b67..bb684ddf2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackagePrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newPlanPackagePrice.fixedPriceQuantity invoiceGroupingKey = newPlanPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanPackagePrice.invoicingCycleConfiguration + licenseTypeId = newPlanPackagePrice.licenseTypeId metadata = newPlanPackagePrice.metadata referenceId = newPlanPackagePrice.referenceId additionalProperties = newPlanPackagePrice.additionalProperties.toMutableMap() @@ -865,6 +889,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -955,6 +998,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -984,6 +1028,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1020,6 +1065,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1419,6 +1465,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1442,6 +1489,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1451,5 +1499,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageConfig=$packageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageConfig=$packageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPrice.kt index 432d40e9a..2353c370f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -510,6 +533,7 @@ private constructor( invoiceGroupingKey = newPlanPackageWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanPackageWithAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newPlanPackageWithAllocationPrice.licenseTypeId metadata = newPlanPackageWithAllocationPrice.metadata referenceId = newPlanPackageWithAllocationPrice.referenceId additionalProperties = @@ -876,6 +900,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -966,6 +1009,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -995,6 +1039,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1031,6 +1076,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1678,6 +1724,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1701,6 +1748,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1710,5 +1758,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanPackageWithAllocationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanPackageWithAllocationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPrice.kt index a2e27e4e8..54d9dbf77 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPrice.kt @@ -40,6 +40,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -89,6 +90,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -110,6 +114,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -255,6 +260,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -420,6 +433,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -490,6 +512,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -518,6 +541,7 @@ private constructor( invoiceGroupingKey = newPlanScalableMatrixWithTieredPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanScalableMatrixWithTieredPricingPrice.invoicingCycleConfiguration + licenseTypeId = newPlanScalableMatrixWithTieredPricingPrice.licenseTypeId metadata = newPlanScalableMatrixWithTieredPricingPrice.metadata referenceId = newPlanScalableMatrixWithTieredPricingPrice.referenceId additionalProperties = @@ -890,6 +914,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -983,6 +1026,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1012,6 +1056,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1048,6 +1093,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -2274,6 +2320,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -2297,6 +2344,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -2306,5 +2354,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanScalableMatrixWithTieredPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanScalableMatrixWithTieredPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPrice.kt index 13e0e76c5..6fa85c6b8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -109,6 +113,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -252,6 +257,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -417,6 +430,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -487,6 +509,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -515,6 +538,7 @@ private constructor( invoiceGroupingKey = newPlanScalableMatrixWithUnitPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanScalableMatrixWithUnitPricingPrice.invoicingCycleConfiguration + licenseTypeId = newPlanScalableMatrixWithUnitPricingPrice.licenseTypeId metadata = newPlanScalableMatrixWithUnitPricingPrice.metadata referenceId = newPlanScalableMatrixWithUnitPricingPrice.referenceId additionalProperties = @@ -882,6 +906,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -975,6 +1018,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1004,6 +1048,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1040,6 +1085,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -2095,6 +2141,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -2118,6 +2165,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -2127,5 +2175,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanScalableMatrixWithUnitPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanScalableMatrixWithUnitPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPrice.kt index 77f2b25ac..30325af84 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newPlanThresholdTotalAmountPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanThresholdTotalAmountPrice.invoicingCycleConfiguration + licenseTypeId = newPlanThresholdTotalAmountPrice.licenseTypeId metadata = newPlanThresholdTotalAmountPrice.metadata referenceId = newPlanThresholdTotalAmountPrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1883,6 +1929,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1906,6 +1953,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1915,5 +1963,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanThresholdTotalAmountPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanThresholdTotalAmountPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackagePrice.kt index 2b4b54067..f3e5e6001 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -504,6 +527,7 @@ private constructor( fixedPriceQuantity = newPlanTieredPackagePrice.fixedPriceQuantity invoiceGroupingKey = newPlanTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newPlanTieredPackagePrice.licenseTypeId metadata = newPlanTieredPackagePrice.metadata referenceId = newPlanTieredPackagePrice.referenceId additionalProperties = newPlanTieredPackagePrice.additionalProperties.toMutableMap() @@ -869,6 +893,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -959,6 +1002,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -988,6 +1032,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1024,6 +1069,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1860,6 +1906,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1883,6 +1930,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1892,5 +1940,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanTieredPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageConfig=$tieredPackageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanTieredPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageConfig=$tieredPackageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPrice.kt index bdc83bf3a..519e990e2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -109,6 +113,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -252,6 +257,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -417,6 +430,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -486,6 +508,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -514,6 +537,7 @@ private constructor( invoiceGroupingKey = newPlanTieredPackageWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanTieredPackageWithMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newPlanTieredPackageWithMinimumPrice.licenseTypeId metadata = newPlanTieredPackageWithMinimumPrice.metadata referenceId = newPlanTieredPackageWithMinimumPrice.referenceId additionalProperties = @@ -881,6 +905,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -971,6 +1014,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1000,6 +1044,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1036,6 +1081,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1911,6 +1957,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1934,6 +1981,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1943,5 +1991,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanTieredPackageWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanTieredPackageWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPrice.kt index 38bf989d4..9ca434132 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newPlanTieredPrice.fixedPriceQuantity invoiceGroupingKey = newPlanTieredPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanTieredPrice.invoicingCycleConfiguration + licenseTypeId = newPlanTieredPrice.licenseTypeId metadata = newPlanTieredPrice.metadata referenceId = newPlanTieredPrice.referenceId additionalProperties = newPlanTieredPrice.additionalProperties.toMutableMap() @@ -865,6 +889,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -955,6 +998,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -984,6 +1028,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1020,6 +1065,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1419,6 +1465,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1442,6 +1489,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1451,5 +1499,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanTieredPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredConfig=$tieredConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanTieredPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredConfig=$tieredConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPrice.kt index 299ef06bf..d21c15292 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -506,6 +529,7 @@ private constructor( fixedPriceQuantity = newPlanTieredWithMinimumPrice.fixedPriceQuantity invoiceGroupingKey = newPlanTieredWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanTieredWithMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newPlanTieredWithMinimumPrice.licenseTypeId metadata = newPlanTieredWithMinimumPrice.metadata referenceId = newPlanTieredWithMinimumPrice.referenceId additionalProperties = newPlanTieredWithMinimumPrice.additionalProperties.toMutableMap() @@ -872,6 +896,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -962,6 +1005,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -991,6 +1035,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1027,6 +1072,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1948,6 +1994,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1971,6 +2018,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1980,5 +2028,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanTieredWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanTieredWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitPrice.kt index 5dcd3e753..3c1590593 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newPlanUnitPrice.fixedPriceQuantity invoiceGroupingKey = newPlanUnitPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanUnitPrice.invoicingCycleConfiguration + licenseTypeId = newPlanUnitPrice.licenseTypeId metadata = newPlanUnitPrice.metadata referenceId = newPlanUnitPrice.referenceId additionalProperties = newPlanUnitPrice.additionalProperties.toMutableMap() @@ -863,6 +887,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -953,6 +996,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -982,6 +1026,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1018,6 +1063,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1417,6 +1463,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1440,6 +1487,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1449,5 +1497,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanUnitPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitConfig=$unitConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanUnitPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitConfig=$unitConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPrice.kt index 2070811bc..a816e1e5b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -481,6 +503,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -504,6 +527,7 @@ private constructor( fixedPriceQuantity = newPlanUnitWithPercentPrice.fixedPriceQuantity invoiceGroupingKey = newPlanUnitWithPercentPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanUnitWithPercentPrice.invoicingCycleConfiguration + licenseTypeId = newPlanUnitWithPercentPrice.licenseTypeId metadata = newPlanUnitWithPercentPrice.metadata referenceId = newPlanUnitWithPercentPrice.referenceId additionalProperties = newPlanUnitWithPercentPrice.additionalProperties.toMutableMap() @@ -869,6 +893,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -959,6 +1002,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -988,6 +1032,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1024,6 +1069,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1628,6 +1674,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1651,6 +1698,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1660,5 +1708,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanUnitWithPercentPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanUnitWithPercentPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPrice.kt index 47b377682..fb71b81d9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -505,6 +528,7 @@ private constructor( fixedPriceQuantity = newPlanUnitWithProrationPrice.fixedPriceQuantity invoiceGroupingKey = newPlanUnitWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newPlanUnitWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newPlanUnitWithProrationPrice.licenseTypeId metadata = newPlanUnitWithProrationPrice.metadata referenceId = newPlanUnitWithProrationPrice.referenceId additionalProperties = newPlanUnitWithProrationPrice.additionalProperties.toMutableMap() @@ -871,6 +895,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -961,6 +1004,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -990,6 +1034,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1026,6 +1071,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1589,6 +1635,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1612,6 +1659,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1621,5 +1669,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanUnitWithProrationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewPlanUnitWithProrationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkPrice.kt index b10d26b6b..b877b8a5e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newSubscriptionBulkPrice.fixedPriceQuantity invoiceGroupingKey = newSubscriptionBulkPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionBulkPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionBulkPrice.licenseTypeId metadata = newSubscriptionBulkPrice.metadata referenceId = newSubscriptionBulkPrice.referenceId additionalProperties = newSubscriptionBulkPrice.additionalProperties.toMutableMap() @@ -863,6 +887,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -953,6 +996,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -982,6 +1026,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1018,6 +1063,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1417,6 +1463,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1440,6 +1487,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1449,5 +1497,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionBulkPrice{bulkConfig=$bulkConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionBulkPrice{bulkConfig=$bulkConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPrice.kt index 7ce89bc09..3ca82cf7a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -510,6 +533,7 @@ private constructor( invoiceGroupingKey = newSubscriptionBulkWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionBulkWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionBulkWithProrationPrice.licenseTypeId metadata = newSubscriptionBulkWithProrationPrice.metadata referenceId = newSubscriptionBulkWithProrationPrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1831,6 +1877,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1854,6 +1901,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1863,5 +1911,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPrice.kt index 0714087d9..e9cab7bc0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -512,6 +535,7 @@ private constructor( invoiceGroupingKey = newSubscriptionCumulativeGroupedBulkPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionCumulativeGroupedBulkPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionCumulativeGroupedBulkPrice.licenseTypeId metadata = newSubscriptionCumulativeGroupedBulkPrice.metadata referenceId = newSubscriptionCumulativeGroupedBulkPrice.referenceId additionalProperties = @@ -878,6 +902,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -968,6 +1011,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -997,6 +1041,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1033,6 +1078,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1920,6 +1966,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1943,6 +1990,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1952,5 +2000,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionCumulativeGroupedBulkPrice{cadence=$cadence, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionCumulativeGroupedBulkPrice{cadence=$cadence, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPrice.kt index 40d24c3aa..ce144b1a4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -509,6 +532,7 @@ private constructor( invoiceGroupingKey = newSubscriptionGroupedAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionGroupedAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionGroupedAllocationPrice.licenseTypeId metadata = newSubscriptionGroupedAllocationPrice.metadata referenceId = newSubscriptionGroupedAllocationPrice.referenceId additionalProperties = @@ -876,6 +900,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -966,6 +1009,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -995,6 +1039,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1031,6 +1076,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1686,6 +1732,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1709,6 +1756,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1718,5 +1766,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionGroupedAllocationPrice{cadence=$cadence, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionGroupedAllocationPrice{cadence=$cadence, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePrice.kt index f5474be24..6786c525e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -512,6 +535,7 @@ private constructor( invoiceGroupingKey = newSubscriptionGroupedTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionGroupedTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionGroupedTieredPackagePrice.licenseTypeId metadata = newSubscriptionGroupedTieredPackagePrice.metadata referenceId = newSubscriptionGroupedTieredPackagePrice.referenceId additionalProperties = @@ -878,6 +902,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -968,6 +1011,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -997,6 +1041,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1033,6 +1078,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1912,6 +1958,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1935,6 +1982,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1944,5 +1992,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionGroupedTieredPackagePrice{cadence=$cadence, groupedTieredPackageConfig=$groupedTieredPackageConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionGroupedTieredPackagePrice{cadence=$cadence, groupedTieredPackageConfig=$groupedTieredPackageConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPrice.kt index 69f5529b7..8e745368f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -509,6 +532,7 @@ private constructor( invoiceGroupingKey = newSubscriptionGroupedTieredPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionGroupedTieredPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionGroupedTieredPrice.licenseTypeId metadata = newSubscriptionGroupedTieredPrice.metadata referenceId = newSubscriptionGroupedTieredPrice.referenceId additionalProperties = @@ -875,6 +899,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -965,6 +1008,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -994,6 +1038,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1030,6 +1075,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1868,6 +1914,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1891,6 +1938,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1900,5 +1948,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionGroupedTieredPrice{cadence=$cadence, groupedTieredConfig=$groupedTieredConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionGroupedTieredPrice{cadence=$cadence, groupedTieredConfig=$groupedTieredConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPrice.kt index 065e8f678..d7e6c1664 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -109,6 +113,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -252,6 +257,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -417,6 +430,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -486,6 +508,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -516,6 +539,7 @@ private constructor( invoiceGroupingKey = newSubscriptionGroupedWithMeteredMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionGroupedWithMeteredMinimumPrice.licenseTypeId metadata = newSubscriptionGroupedWithMeteredMinimumPrice.metadata referenceId = newSubscriptionGroupedWithMeteredMinimumPrice.referenceId additionalProperties = @@ -883,6 +907,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -973,6 +1016,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1002,6 +1046,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1038,6 +1083,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -2305,6 +2351,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -2328,6 +2375,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -2337,5 +2385,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionGroupedWithMeteredMinimumPrice{cadence=$cadence, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionGroupedWithMeteredMinimumPrice{cadence=$cadence, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPrice.kt index 477c3494b..ad6146e66 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -485,6 +507,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -515,6 +538,7 @@ private constructor( invoiceGroupingKey = newSubscriptionGroupedWithProratedMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionGroupedWithProratedMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionGroupedWithProratedMinimumPrice.licenseTypeId metadata = newSubscriptionGroupedWithProratedMinimumPrice.metadata referenceId = newSubscriptionGroupedWithProratedMinimumPrice.referenceId additionalProperties = @@ -882,6 +906,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -972,6 +1015,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1001,6 +1045,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1037,6 +1082,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1685,6 +1731,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1708,6 +1755,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1717,5 +1765,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionGroupedWithProratedMinimumPrice{cadence=$cadence, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionGroupedWithProratedMinimumPrice{cadence=$cadence, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixPrice.kt index eb63bedb1..356f8db1f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newSubscriptionMatrixPrice.fixedPriceQuantity invoiceGroupingKey = newSubscriptionMatrixPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionMatrixPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionMatrixPrice.licenseTypeId metadata = newSubscriptionMatrixPrice.metadata referenceId = newSubscriptionMatrixPrice.referenceId additionalProperties = newSubscriptionMatrixPrice.additionalProperties.toMutableMap() @@ -865,6 +889,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -955,6 +998,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -984,6 +1028,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1020,6 +1065,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1419,6 +1465,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1442,6 +1489,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1451,5 +1499,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionMatrixPrice{cadence=$cadence, itemId=$itemId, matrixConfig=$matrixConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionMatrixPrice{cadence=$cadence, itemId=$itemId, matrixConfig=$matrixConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPrice.kt index 1b57eceb5..e5ea755c1 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newSubscriptionMatrixWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionMatrixWithAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionMatrixWithAllocationPrice.licenseTypeId metadata = newSubscriptionMatrixWithAllocationPrice.metadata referenceId = newSubscriptionMatrixWithAllocationPrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1431,6 +1477,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1454,6 +1501,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1463,5 +1511,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionMatrixWithAllocationPrice{cadence=$cadence, itemId=$itemId, matrixWithAllocationConfig=$matrixWithAllocationConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionMatrixWithAllocationPrice{cadence=$cadence, itemId=$itemId, matrixWithAllocationConfig=$matrixWithAllocationConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePrice.kt index 17fb78a46..93f226805 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -512,6 +535,7 @@ private constructor( invoiceGroupingKey = newSubscriptionMatrixWithDisplayNamePrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionMatrixWithDisplayNamePrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionMatrixWithDisplayNamePrice.licenseTypeId metadata = newSubscriptionMatrixWithDisplayNamePrice.metadata referenceId = newSubscriptionMatrixWithDisplayNamePrice.referenceId additionalProperties = @@ -878,6 +902,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -968,6 +1011,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -997,6 +1041,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1033,6 +1078,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1921,6 +1967,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1944,6 +1991,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1953,5 +2001,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionMatrixWithDisplayNamePrice{cadence=$cadence, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionMatrixWithDisplayNamePrice{cadence=$cadence, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePrice.kt index cc8472998..4b874f38d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -512,6 +535,7 @@ private constructor( invoiceGroupingKey = newSubscriptionMaxGroupTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionMaxGroupTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionMaxGroupTieredPackagePrice.licenseTypeId metadata = newSubscriptionMaxGroupTieredPackagePrice.metadata referenceId = newSubscriptionMaxGroupTieredPackagePrice.referenceId additionalProperties = @@ -878,6 +902,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -968,6 +1011,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -997,6 +1041,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1033,6 +1078,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1913,6 +1959,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1936,6 +1983,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1945,5 +1993,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionMaxGroupTieredPackagePrice{cadence=$cadence, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionMaxGroupTieredPackagePrice{cadence=$cadence, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePrice.kt index 0ea7c4a45..dd7c80b30 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -509,6 +532,7 @@ private constructor( invoiceGroupingKey = newSubscriptionMinimumCompositePrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionMinimumCompositePrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionMinimumCompositePrice.licenseTypeId metadata = newSubscriptionMinimumCompositePrice.metadata referenceId = newSubscriptionMinimumCompositePrice.referenceId additionalProperties = @@ -876,6 +900,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -966,6 +1009,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -995,6 +1039,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1031,6 +1076,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1638,6 +1684,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1661,6 +1708,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1670,5 +1718,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionMinimumCompositePrice{cadence=$cadence, itemId=$itemId, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionMinimumCompositePrice{cadence=$cadence, itemId=$itemId, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackagePrice.kt index 421584a46..688cb675b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackagePrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -502,6 +525,7 @@ private constructor( fixedPriceQuantity = newSubscriptionPackagePrice.fixedPriceQuantity invoiceGroupingKey = newSubscriptionPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionPackagePrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionPackagePrice.licenseTypeId metadata = newSubscriptionPackagePrice.metadata referenceId = newSubscriptionPackagePrice.referenceId additionalProperties = newSubscriptionPackagePrice.additionalProperties.toMutableMap() @@ -866,6 +890,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -956,6 +999,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -985,6 +1029,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1021,6 +1066,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1420,6 +1466,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1443,6 +1490,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1452,5 +1500,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageConfig=$packageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageConfig=$packageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPrice.kt index a61347544..1987a942a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -511,6 +534,7 @@ private constructor( invoiceGroupingKey = newSubscriptionPackageWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionPackageWithAllocationPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionPackageWithAllocationPrice.licenseTypeId metadata = newSubscriptionPackageWithAllocationPrice.metadata referenceId = newSubscriptionPackageWithAllocationPrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1679,6 +1725,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1702,6 +1749,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1711,5 +1759,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionPackageWithAllocationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionPackageWithAllocationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPrice.kt index e6c9a0281..c0a452ab3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPrice.kt @@ -40,6 +40,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -89,6 +90,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -110,6 +114,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -255,6 +260,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -420,6 +433,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -490,6 +512,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -523,6 +546,7 @@ private constructor( newSubscriptionScalableMatrixWithTieredPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionScalableMatrixWithTieredPricingPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionScalableMatrixWithTieredPricingPrice.licenseTypeId metadata = newSubscriptionScalableMatrixWithTieredPricingPrice.metadata referenceId = newSubscriptionScalableMatrixWithTieredPricingPrice.referenceId additionalProperties = @@ -896,6 +920,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -989,6 +1032,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1018,6 +1062,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1054,6 +1099,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -2280,6 +2326,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -2303,6 +2350,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -2312,5 +2360,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionScalableMatrixWithTieredPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionScalableMatrixWithTieredPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPrice.kt index dc6e01f4f..960a0211e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -109,6 +113,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -252,6 +257,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -417,6 +430,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -487,6 +509,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -520,6 +543,7 @@ private constructor( newSubscriptionScalableMatrixWithUnitPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionScalableMatrixWithUnitPricingPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionScalableMatrixWithUnitPricingPrice.licenseTypeId metadata = newSubscriptionScalableMatrixWithUnitPricingPrice.metadata referenceId = newSubscriptionScalableMatrixWithUnitPricingPrice.referenceId additionalProperties = @@ -888,6 +912,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -981,6 +1024,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1010,6 +1054,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1046,6 +1091,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -2101,6 +2147,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -2124,6 +2171,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -2133,5 +2181,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionScalableMatrixWithUnitPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionScalableMatrixWithUnitPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPrice.kt index e1b30a7fc..cf471158b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -416,6 +429,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -484,6 +506,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -512,6 +535,7 @@ private constructor( invoiceGroupingKey = newSubscriptionThresholdTotalAmountPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionThresholdTotalAmountPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionThresholdTotalAmountPrice.licenseTypeId metadata = newSubscriptionThresholdTotalAmountPrice.metadata referenceId = newSubscriptionThresholdTotalAmountPrice.referenceId additionalProperties = @@ -878,6 +902,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -968,6 +1011,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -997,6 +1041,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1033,6 +1078,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1884,6 +1930,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1907,6 +1954,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1916,5 +1964,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionThresholdTotalAmountPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionThresholdTotalAmountPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePrice.kt index 5c3968092..eb608b0b3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -509,6 +532,7 @@ private constructor( invoiceGroupingKey = newSubscriptionTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionTieredPackagePrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionTieredPackagePrice.licenseTypeId metadata = newSubscriptionTieredPackagePrice.metadata referenceId = newSubscriptionTieredPackagePrice.referenceId additionalProperties = @@ -875,6 +899,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -965,6 +1008,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -994,6 +1038,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1030,6 +1075,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1866,6 +1912,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1889,6 +1936,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1898,5 +1946,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionTieredPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageConfig=$tieredPackageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionTieredPackagePrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageConfig=$tieredPackageConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPrice.kt index 9036a3f93..a27ad027f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -88,6 +89,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -109,6 +113,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -252,6 +257,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -417,6 +430,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -486,6 +508,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -515,6 +538,7 @@ private constructor( invoiceGroupingKey = newSubscriptionTieredPackageWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionTieredPackageWithMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionTieredPackageWithMinimumPrice.licenseTypeId metadata = newSubscriptionTieredPackageWithMinimumPrice.metadata referenceId = newSubscriptionTieredPackageWithMinimumPrice.referenceId additionalProperties = @@ -882,6 +906,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -972,6 +1015,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -1001,6 +1045,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1037,6 +1082,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1912,6 +1958,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1935,6 +1982,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1944,5 +1992,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionTieredPackageWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionTieredPackageWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPrice.kt index 79610bbce..56119fb58 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newSubscriptionTieredPrice.fixedPriceQuantity invoiceGroupingKey = newSubscriptionTieredPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionTieredPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionTieredPrice.licenseTypeId metadata = newSubscriptionTieredPrice.metadata referenceId = newSubscriptionTieredPrice.referenceId additionalProperties = newSubscriptionTieredPrice.additionalProperties.toMutableMap() @@ -865,6 +889,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -955,6 +998,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -984,6 +1028,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1020,6 +1065,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1419,6 +1465,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1442,6 +1489,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1451,5 +1499,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionTieredPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredConfig=$tieredConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionTieredPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredConfig=$tieredConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPrice.kt index ec6a48bdb..221a7a3a6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPrice.kt @@ -39,6 +39,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -87,6 +88,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -108,6 +112,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -251,6 +256,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -415,6 +428,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -483,6 +505,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -510,6 +533,7 @@ private constructor( invoiceGroupingKey = newSubscriptionTieredWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionTieredWithMinimumPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionTieredWithMinimumPrice.licenseTypeId metadata = newSubscriptionTieredWithMinimumPrice.metadata referenceId = newSubscriptionTieredWithMinimumPrice.referenceId additionalProperties = @@ -877,6 +901,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -967,6 +1010,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -996,6 +1040,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1032,6 +1077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1953,6 +1999,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1976,6 +2023,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1985,5 +2033,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionTieredWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionTieredWithMinimumPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitPrice.kt index 4d209d5f6..efc051922 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -249,6 +254,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -412,6 +425,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -479,6 +501,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -501,6 +524,7 @@ private constructor( fixedPriceQuantity = newSubscriptionUnitPrice.fixedPriceQuantity invoiceGroupingKey = newSubscriptionUnitPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionUnitPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionUnitPrice.licenseTypeId metadata = newSubscriptionUnitPrice.metadata referenceId = newSubscriptionUnitPrice.referenceId additionalProperties = newSubscriptionUnitPrice.additionalProperties.toMutableMap() @@ -863,6 +887,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -953,6 +996,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -982,6 +1026,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1018,6 +1063,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1417,6 +1463,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1440,6 +1487,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1449,5 +1497,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionUnitPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitConfig=$unitConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionUnitPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitConfig=$unitConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPrice.kt index fb86e9e26..9a12bdbfd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -509,6 +532,7 @@ private constructor( invoiceGroupingKey = newSubscriptionUnitWithPercentPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionUnitWithPercentPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionUnitWithPercentPrice.licenseTypeId metadata = newSubscriptionUnitWithPercentPrice.metadata referenceId = newSubscriptionUnitWithPercentPrice.referenceId additionalProperties = @@ -875,6 +899,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -965,6 +1008,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -994,6 +1038,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1030,6 +1075,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1634,6 +1680,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1657,6 +1704,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1666,5 +1714,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionUnitWithPercentPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionUnitWithPercentPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPrice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPrice.kt index f41dd44b1..ceca63908 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPrice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPrice.kt @@ -38,6 +38,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -86,6 +87,9 @@ private constructor( @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("reference_id") @ExcludeMissing @@ -107,6 +111,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -250,6 +255,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -414,6 +427,15 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -482,6 +504,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -509,6 +532,7 @@ private constructor( invoiceGroupingKey = newSubscriptionUnitWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = newSubscriptionUnitWithProrationPrice.invoicingCycleConfiguration + licenseTypeId = newSubscriptionUnitWithProrationPrice.licenseTypeId metadata = newSubscriptionUnitWithProrationPrice.metadata referenceId = newSubscriptionUnitWithProrationPrice.referenceId additionalProperties = @@ -876,6 +900,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -966,6 +1009,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -995,6 +1039,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -1031,6 +1076,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -1594,6 +1640,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -1617,6 +1664,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -1626,5 +1674,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewSubscriptionUnitWithProrationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "NewSubscriptionUnitWithProrationPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } 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 83f76051e..925f78030 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 @@ -2940,6 +2940,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -2998,6 +2999,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -3021,6 +3025,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -3180,6 +3185,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -3349,6 +3362,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -3422,6 +3445,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3445,6 +3469,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -3863,6 +3888,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -3959,6 +4005,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -3992,6 +4039,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -4029,6 +4077,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -5026,6 +5075,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -5049,6 +5099,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -5058,7 +5109,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -5081,6 +5132,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -5140,6 +5192,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -5163,6 +5218,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -5322,6 +5378,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -5491,6 +5555,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -5566,6 +5640,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -5590,6 +5665,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -6010,6 +6086,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -6106,6 +6203,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -6139,6 +6237,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -6178,6 +6277,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -6892,6 +6992,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -6915,6 +7016,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -6924,7 +7026,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -6948,6 +7050,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -7008,6 +7111,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -7031,6 +7137,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -7192,6 +7299,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7361,6 +7476,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7438,6 +7563,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7465,6 +7591,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -7892,6 +8019,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -7991,6 +8139,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -8024,6 +8173,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -8063,6 +8213,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -8685,6 +8836,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -8708,6 +8860,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -8717,7 +8870,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -8741,6 +8894,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -8801,6 +8955,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8824,6 +8981,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -8985,6 +9143,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -9154,6 +9320,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9231,6 +9407,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9258,6 +9435,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -9685,6 +9863,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9784,6 +9983,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -9817,6 +10017,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -9856,6 +10057,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -10485,6 +10687,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -10508,6 +10711,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -10517,7 +10721,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -10540,6 +10744,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -10598,6 +10803,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -10621,6 +10829,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -10779,6 +10988,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -10947,6 +11164,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -11020,6 +11247,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -11042,6 +11270,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -11460,6 +11689,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -11556,6 +11806,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -11589,6 +11840,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -11626,6 +11878,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -12095,6 +12348,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -12118,6 +12372,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -12127,7 +12382,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -12150,6 +12405,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -12208,6 +12464,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -12231,6 +12490,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -12390,6 +12650,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -12558,6 +12826,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -12631,6 +12909,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -12653,6 +12932,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -13071,6 +13351,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -13167,6 +13468,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -13200,6 +13502,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -13237,6 +13540,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -13826,6 +14130,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -13849,6 +14154,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -13858,7 +14164,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } 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 efc13af59..7f69da9a1 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 @@ -1205,6 +1205,7 @@ private constructor( private val replacesPriceId: JsonField, private val unitConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -1281,6 +1282,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -1310,6 +1314,7 @@ private constructor( replacesPriceId, unitConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -1511,6 +1516,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -1764,6 +1778,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1846,6 +1869,7 @@ private constructor( private var unitConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1878,6 +1902,7 @@ private constructor( replacesPriceId = unitPrice.replacesPriceId unitConfig = unitPrice.unitConfig dimensionalPriceConfiguration = unitPrice.dimensionalPriceConfiguration + licenseType = unitPrice.licenseType additionalProperties = unitPrice.additionalProperties.toMutableMap() } @@ -2506,6 +2531,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -2594,6 +2642,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("unitConfig", unitConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -2637,6 +2686,7 @@ private constructor( replacesPriceId() unitConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -2684,7 +2734,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (unitConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -3755,6 +3806,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -3789,6 +4098,7 @@ private constructor( replacesPriceId == other.replacesPriceId && unitConfig == other.unitConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -3822,6 +4132,7 @@ private constructor( replacesPriceId, unitConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -3829,7 +4140,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, unitConfig=$unitConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "UnitPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, unitConfig=$unitConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class Tiered @@ -3863,6 +4174,7 @@ private constructor( private val replacesPriceId: JsonField, private val tieredConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -3939,6 +4251,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -3968,6 +4283,7 @@ private constructor( replacesPriceId, tieredConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -4169,6 +4485,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -4423,6 +4748,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -4505,6 +4839,7 @@ private constructor( private var tieredConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -4537,6 +4872,7 @@ private constructor( replacesPriceId = tiered.replacesPriceId tieredConfig = tiered.tieredConfig dimensionalPriceConfiguration = tiered.dimensionalPriceConfiguration + licenseType = tiered.licenseType additionalProperties = tiered.additionalProperties.toMutableMap() } @@ -5165,6 +5501,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -5253,6 +5612,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("tieredConfig", tieredConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -5296,6 +5656,7 @@ private constructor( replacesPriceId() tieredConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -5343,7 +5704,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (tieredConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -6414,6 +6776,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -6448,6 +7068,7 @@ private constructor( replacesPriceId == other.replacesPriceId && tieredConfig == other.tieredConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -6481,6 +7102,7 @@ private constructor( replacesPriceId, tieredConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -6488,7 +7110,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Tiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredConfig=$tieredConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "Tiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredConfig=$tieredConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class Bulk @@ -6522,6 +7144,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -6598,6 +7221,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -6627,6 +7253,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -6828,6 +7455,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -7081,6 +7717,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -7163,6 +7808,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -7195,6 +7841,7 @@ private constructor( priceType = bulk.priceType replacesPriceId = bulk.replacesPriceId dimensionalPriceConfiguration = bulk.dimensionalPriceConfiguration + licenseType = bulk.licenseType additionalProperties = bulk.additionalProperties.toMutableMap() } @@ -7823,6 +8470,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7911,6 +8581,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -7954,6 +8625,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -8001,7 +8673,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -9072,6 +9745,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -9106,6 +10037,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -9139,6 +10071,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -9146,7 +10079,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Bulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, bulkConfig=$bulkConfig, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "Bulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, bulkConfig=$bulkConfig, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class BulkWithFilters @@ -9180,6 +10113,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -9256,6 +10190,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -9285,6 +10222,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -9487,6 +10425,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -9741,6 +10688,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -9823,6 +10779,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -9856,6 +10813,7 @@ private constructor( priceType = bulkWithFilters.priceType replacesPriceId = bulkWithFilters.replacesPriceId dimensionalPriceConfiguration = bulkWithFilters.dimensionalPriceConfiguration + licenseType = bulkWithFilters.licenseType additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() } @@ -10486,6 +11444,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -10574,6 +11555,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -10617,6 +11599,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -10664,7 +11647,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -12421,6 +13405,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -12455,6 +13697,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -12488,6 +13731,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -12495,7 +13739,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "BulkWithFilters{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class Package @@ -12529,6 +13773,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -12605,6 +13850,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -12634,6 +13882,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -12835,6 +14084,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -13089,6 +14347,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -13171,6 +14438,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -13203,6 +14471,7 @@ private constructor( priceType = package_.priceType replacesPriceId = package_.replacesPriceId dimensionalPriceConfiguration = package_.dimensionalPriceConfiguration + licenseType = package_.licenseType additionalProperties = package_.additionalProperties.toMutableMap() } @@ -13832,6 +15101,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -13920,6 +15212,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -13963,6 +15256,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -14010,7 +15304,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -15081,6 +16376,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -15115,6 +16668,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -15148,6 +16702,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -15155,7 +16710,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Package{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "Package{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class Matrix @@ -15189,6 +16744,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -15265,6 +16821,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -15294,6 +16853,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -15495,6 +17055,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -15749,6 +17318,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -15831,6 +17409,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -15863,6 +17442,7 @@ private constructor( priceType = matrix.priceType replacesPriceId = matrix.replacesPriceId dimensionalPriceConfiguration = matrix.dimensionalPriceConfiguration + licenseType = matrix.licenseType additionalProperties = matrix.additionalProperties.toMutableMap() } @@ -16491,6 +18071,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -16579,6 +18182,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -16622,6 +18226,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -16669,7 +18274,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -17740,6 +19346,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -17774,6 +19638,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -17807,6 +19672,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -17814,7 +19680,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Matrix{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "Matrix{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class ThresholdTotalAmount @@ -17848,6 +19714,7 @@ private constructor( private val replacesPriceId: JsonField, private val thresholdTotalAmountConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -17924,6 +19791,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -17953,6 +19823,7 @@ private constructor( replacesPriceId, thresholdTotalAmountConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -18155,6 +20026,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -18410,6 +20290,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -18492,6 +20381,7 @@ private constructor( private var thresholdTotalAmountConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -18525,6 +20415,7 @@ private constructor( replacesPriceId = thresholdTotalAmount.replacesPriceId thresholdTotalAmountConfig = thresholdTotalAmount.thresholdTotalAmountConfig dimensionalPriceConfiguration = thresholdTotalAmount.dimensionalPriceConfiguration + licenseType = thresholdTotalAmount.licenseType additionalProperties = thresholdTotalAmount.additionalProperties.toMutableMap() } @@ -19154,6 +21045,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -19242,6 +21156,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("thresholdTotalAmountConfig", thresholdTotalAmountConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -19285,6 +21200,7 @@ private constructor( replacesPriceId() thresholdTotalAmountConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -19332,7 +21248,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (thresholdTotalAmountConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -20865,6 +22782,264 @@ private constructor( "ThresholdTotalAmountConfig{consumptionTable=$consumptionTable, prorate=$prorate, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -20899,6 +23074,7 @@ private constructor( replacesPriceId == other.replacesPriceId && thresholdTotalAmountConfig == other.thresholdTotalAmountConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -20932,6 +23108,7 @@ private constructor( replacesPriceId, thresholdTotalAmountConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -20939,7 +23116,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ThresholdTotalAmount{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "ThresholdTotalAmount{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class TieredPackage @@ -20973,6 +23150,7 @@ private constructor( private val replacesPriceId: JsonField, private val tieredPackageConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -21049,6 +23227,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -21078,6 +23259,7 @@ private constructor( replacesPriceId, tieredPackageConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -21280,6 +23462,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -21534,6 +23725,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -21616,6 +23816,7 @@ private constructor( private var tieredPackageConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -21649,6 +23850,7 @@ private constructor( replacesPriceId = tieredPackage.replacesPriceId tieredPackageConfig = tieredPackage.tieredPackageConfig dimensionalPriceConfiguration = tieredPackage.dimensionalPriceConfiguration + licenseType = tieredPackage.licenseType additionalProperties = tieredPackage.additionalProperties.toMutableMap() } @@ -22278,6 +24480,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -22366,6 +24591,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("tieredPackageConfig", tieredPackageConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -22409,6 +24635,7 @@ private constructor( replacesPriceId() tieredPackageConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -22456,7 +24683,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (tieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -23977,6 +26205,264 @@ private constructor( "TieredPackageConfig{packageSize=$packageSize, tiers=$tiers, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -24011,6 +26497,7 @@ private constructor( replacesPriceId == other.replacesPriceId && tieredPackageConfig == other.tieredPackageConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -24044,6 +26531,7 @@ private constructor( replacesPriceId, tieredPackageConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -24051,7 +26539,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredPackageConfig=$tieredPackageConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "TieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredPackageConfig=$tieredPackageConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class TieredWithMinimum @@ -24085,6 +26573,7 @@ private constructor( private val replacesPriceId: JsonField, private val tieredWithMinimumConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -24161,6 +26650,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -24190,6 +26682,7 @@ private constructor( replacesPriceId, tieredWithMinimumConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -24392,6 +26885,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -24646,6 +27148,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -24728,6 +27239,7 @@ private constructor( private var tieredWithMinimumConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -24761,6 +27273,7 @@ private constructor( replacesPriceId = tieredWithMinimum.replacesPriceId tieredWithMinimumConfig = tieredWithMinimum.tieredWithMinimumConfig dimensionalPriceConfiguration = tieredWithMinimum.dimensionalPriceConfiguration + licenseType = tieredWithMinimum.licenseType additionalProperties = tieredWithMinimum.additionalProperties.toMutableMap() } @@ -25390,6 +27903,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -25478,6 +28014,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -25521,6 +28058,7 @@ private constructor( replacesPriceId() tieredWithMinimumConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -25568,7 +28106,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (tieredWithMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -27173,6 +29712,264 @@ private constructor( "TieredWithMinimumConfig{tiers=$tiers, hideZeroAmountTiers=$hideZeroAmountTiers, prorate=$prorate, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -27207,6 +30004,7 @@ private constructor( replacesPriceId == other.replacesPriceId && tieredWithMinimumConfig == other.tieredWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -27240,6 +30038,7 @@ private constructor( replacesPriceId, tieredWithMinimumConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -27247,7 +30046,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredWithMinimumConfig=$tieredWithMinimumConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "TieredWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredWithMinimumConfig=$tieredWithMinimumConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class GroupedTiered @@ -27281,6 +30080,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -27357,6 +30157,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -27386,6 +30189,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -27588,6 +30392,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -27842,6 +30655,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -27924,6 +30746,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -27957,6 +30780,7 @@ private constructor( priceType = groupedTiered.priceType replacesPriceId = groupedTiered.replacesPriceId dimensionalPriceConfiguration = groupedTiered.dimensionalPriceConfiguration + licenseType = groupedTiered.licenseType additionalProperties = groupedTiered.additionalProperties.toMutableMap() } @@ -28586,6 +31410,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -28674,6 +31521,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -28717,6 +31565,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -28764,7 +31613,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -30285,6 +33135,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -30319,6 +33427,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -30352,6 +33461,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -30359,7 +33469,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "GroupedTiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class TieredPackageWithMinimum @@ -30393,6 +33503,7 @@ private constructor( private val replacesPriceId: JsonField, private val tieredPackageWithMinimumConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -30470,6 +33581,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -30499,6 +33613,7 @@ private constructor( replacesPriceId, tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -30701,6 +33816,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -30956,6 +34080,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -31039,6 +34172,7 @@ private constructor( null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -31074,6 +34208,7 @@ private constructor( tieredPackageWithMinimum.tieredPackageWithMinimumConfig dimensionalPriceConfiguration = tieredPackageWithMinimum.dimensionalPriceConfiguration + licenseType = tieredPackageWithMinimum.licenseType additionalProperties = tieredPackageWithMinimum.additionalProperties.toMutableMap() } @@ -31704,6 +34839,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -31792,6 +34950,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("tieredPackageWithMinimumConfig", tieredPackageWithMinimumConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -31835,6 +34994,7 @@ private constructor( replacesPriceId() tieredPackageWithMinimumConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -31884,7 +35044,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (tieredPackageWithMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -33444,6 +36605,264 @@ private constructor( "TieredPackageWithMinimumConfig{packageSize=$packageSize, tiers=$tiers, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -33478,6 +36897,7 @@ private constructor( replacesPriceId == other.replacesPriceId && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -33511,6 +36931,7 @@ private constructor( replacesPriceId, tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -33518,7 +36939,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackageWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "TieredPackageWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class PackageWithAllocation @@ -33552,6 +36973,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -33628,6 +37050,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -33657,6 +37082,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -33859,6 +37285,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -34114,6 +37549,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -34196,6 +37640,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -34229,6 +37674,7 @@ private constructor( priceType = packageWithAllocation.priceType replacesPriceId = packageWithAllocation.replacesPriceId dimensionalPriceConfiguration = packageWithAllocation.dimensionalPriceConfiguration + licenseType = packageWithAllocation.licenseType additionalProperties = packageWithAllocation.additionalProperties.toMutableMap() } @@ -34859,6 +38305,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -34947,6 +38416,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -34990,6 +38460,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -35037,7 +38508,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -36368,6 +39840,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -36402,6 +40132,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -36435,6 +40166,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -36442,7 +40174,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PackageWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "PackageWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class UnitWithPercent @@ -36476,6 +40208,7 @@ private constructor( private val replacesPriceId: JsonField, private val unitWithPercentConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -36552,6 +40285,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -36581,6 +40317,7 @@ private constructor( replacesPriceId, unitWithPercentConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -36783,6 +40520,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -37037,6 +40783,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -37119,6 +40874,7 @@ private constructor( private var unitWithPercentConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -37152,6 +40908,7 @@ private constructor( replacesPriceId = unitWithPercent.replacesPriceId unitWithPercentConfig = unitWithPercent.unitWithPercentConfig dimensionalPriceConfiguration = unitWithPercent.dimensionalPriceConfiguration + licenseType = unitWithPercent.licenseType additionalProperties = unitWithPercent.additionalProperties.toMutableMap() } @@ -37782,6 +41539,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -37870,6 +41650,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("unitWithPercentConfig", unitWithPercentConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -37913,6 +41694,7 @@ private constructor( replacesPriceId() unitWithPercentConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -37960,7 +41742,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (unitWithPercentConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -39247,6 +43030,264 @@ private constructor( "UnitWithPercentConfig{percent=$percent, unitAmount=$unitAmount, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -39281,6 +43322,7 @@ private constructor( replacesPriceId == other.replacesPriceId && unitWithPercentConfig == other.unitWithPercentConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -39314,6 +43356,7 @@ private constructor( replacesPriceId, unitWithPercentConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -39321,7 +43364,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithPercent{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, unitWithPercentConfig=$unitWithPercentConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "UnitWithPercent{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, unitWithPercentConfig=$unitWithPercentConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class MatrixWithAllocation @@ -39355,6 +43398,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -39431,6 +43475,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -39460,6 +43507,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -39662,6 +43710,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -39917,6 +43974,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -39999,6 +44065,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -40032,6 +44099,7 @@ private constructor( priceType = matrixWithAllocation.priceType replacesPriceId = matrixWithAllocation.replacesPriceId dimensionalPriceConfiguration = matrixWithAllocation.dimensionalPriceConfiguration + licenseType = matrixWithAllocation.licenseType additionalProperties = matrixWithAllocation.additionalProperties.toMutableMap() } @@ -40661,6 +44729,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -40749,6 +44840,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -40792,6 +44884,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -40839,7 +44932,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -41910,6 +46004,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -41944,6 +46296,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -41977,6 +46330,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -41984,7 +46338,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "MatrixWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -42018,6 +46372,7 @@ private constructor( private val replacesPriceId: JsonField, private val tieredWithProrationConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -42094,6 +46449,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -42123,6 +46481,7 @@ private constructor( replacesPriceId, tieredWithProrationConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -42325,6 +46684,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -42580,6 +46948,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -42662,6 +47039,7 @@ private constructor( private var tieredWithProrationConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -42695,6 +47073,7 @@ private constructor( replacesPriceId = tieredWithProration.replacesPriceId tieredWithProrationConfig = tieredWithProration.tieredWithProrationConfig dimensionalPriceConfiguration = tieredWithProration.dimensionalPriceConfiguration + licenseType = tieredWithProration.licenseType additionalProperties = tieredWithProration.additionalProperties.toMutableMap() } @@ -43324,6 +47703,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -43412,6 +47814,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -43455,6 +47858,7 @@ private constructor( replacesPriceId() tieredWithProrationConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -43502,7 +47906,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (tieredWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -44982,6 +49387,264 @@ private constructor( "TieredWithProrationConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -45016,6 +49679,7 @@ private constructor( replacesPriceId == other.replacesPriceId && tieredWithProrationConfig == other.tieredWithProrationConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -45049,6 +49713,7 @@ private constructor( replacesPriceId, tieredWithProrationConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -45056,7 +49721,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredWithProrationConfig=$tieredWithProrationConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "TieredWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, tieredWithProrationConfig=$tieredWithProrationConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class UnitWithProration @@ -45090,6 +49755,7 @@ private constructor( private val replacesPriceId: JsonField, private val unitWithProrationConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -45166,6 +49832,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -45195,6 +49864,7 @@ private constructor( replacesPriceId, unitWithProrationConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -45397,6 +50067,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -45651,6 +50330,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -45733,6 +50421,7 @@ private constructor( private var unitWithProrationConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -45766,6 +50455,7 @@ private constructor( replacesPriceId = unitWithProration.replacesPriceId unitWithProrationConfig = unitWithProration.unitWithProrationConfig dimensionalPriceConfiguration = unitWithProration.dimensionalPriceConfiguration + licenseType = unitWithProration.licenseType additionalProperties = unitWithProration.additionalProperties.toMutableMap() } @@ -46395,6 +51085,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -46483,6 +51196,7 @@ private constructor( checkRequired("replacesPriceId", replacesPriceId), checkRequired("unitWithProrationConfig", unitWithProrationConfig), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -46526,6 +51240,7 @@ private constructor( replacesPriceId() unitWithProrationConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -46573,7 +51288,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (unitWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -47818,6 +52534,264 @@ private constructor( "UnitWithProrationConfig{unitAmount=$unitAmount, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -47852,6 +52826,7 @@ private constructor( replacesPriceId == other.replacesPriceId && unitWithProrationConfig == other.unitWithProrationConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -47885,6 +52860,7 @@ private constructor( replacesPriceId, unitWithProrationConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -47892,7 +52868,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, unitWithProrationConfig=$unitWithProrationConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "UnitWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, unitWithProrationConfig=$unitWithProrationConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class GroupedAllocation @@ -47926,6 +52902,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -48002,6 +52979,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -48031,6 +53011,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -48233,6 +53214,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -48487,6 +53477,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -48569,6 +53568,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -48602,6 +53602,7 @@ private constructor( priceType = groupedAllocation.priceType replacesPriceId = groupedAllocation.replacesPriceId dimensionalPriceConfiguration = groupedAllocation.dimensionalPriceConfiguration + licenseType = groupedAllocation.licenseType additionalProperties = groupedAllocation.additionalProperties.toMutableMap() } @@ -49231,6 +54232,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -49319,6 +54343,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -49362,6 +54387,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -49409,7 +54435,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -50748,6 +55775,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -50782,6 +56067,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -50815,6 +56101,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -50822,7 +56109,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "GroupedAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class BulkWithProration @@ -50856,6 +56143,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -50932,6 +56220,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -50961,6 +56252,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -51163,6 +56455,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -51417,6 +56718,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -51499,6 +56809,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -51532,6 +56843,7 @@ private constructor( priceType = bulkWithProration.priceType replacesPriceId = bulkWithProration.replacesPriceId dimensionalPriceConfiguration = bulkWithProration.dimensionalPriceConfiguration + licenseType = bulkWithProration.licenseType additionalProperties = bulkWithProration.additionalProperties.toMutableMap() } @@ -52161,6 +57473,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -52249,6 +57584,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -52292,6 +57628,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -52339,7 +57676,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -53820,6 +59158,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -53854,6 +59450,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -53887,6 +59484,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -53894,7 +59492,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "BulkWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class GroupedWithProratedMinimum @@ -53928,6 +59526,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -54005,6 +59604,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -54034,6 +59636,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -54236,6 +59839,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -54491,6 +60103,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -54576,6 +60197,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -54611,6 +60233,7 @@ private constructor( replacesPriceId = groupedWithProratedMinimum.replacesPriceId dimensionalPriceConfiguration = groupedWithProratedMinimum.dimensionalPriceConfiguration + licenseType = groupedWithProratedMinimum.licenseType additionalProperties = groupedWithProratedMinimum.additionalProperties.toMutableMap() } @@ -55242,6 +60865,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -55333,6 +60979,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -55376,6 +61023,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -55425,7 +61073,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -56756,6 +62405,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -56790,6 +62697,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -56823,6 +62731,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -56830,7 +62739,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "GroupedWithProratedMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class GroupedWithMeteredMinimum @@ -56864,6 +62773,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -56941,6 +62851,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -56970,6 +62883,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -57172,6 +63086,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -57427,6 +63350,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -57512,6 +63444,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -57547,6 +63480,7 @@ private constructor( replacesPriceId = groupedWithMeteredMinimum.replacesPriceId dimensionalPriceConfiguration = groupedWithMeteredMinimum.dimensionalPriceConfiguration + licenseType = groupedWithMeteredMinimum.licenseType additionalProperties = groupedWithMeteredMinimum.additionalProperties.toMutableMap() } @@ -58177,6 +64111,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -58268,6 +64225,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -58311,6 +64269,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -58360,7 +64319,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -60322,6 +66282,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -60356,6 +66574,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -60389,6 +66608,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -60396,7 +66616,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "GroupedWithMeteredMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -60430,6 +66650,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -60507,6 +66728,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -60536,6 +66760,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -60738,6 +66963,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -60993,6 +67227,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -61078,6 +67321,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -61114,6 +67358,7 @@ private constructor( replacesPriceId = groupedWithMinMaxThresholds.replacesPriceId dimensionalPriceConfiguration = groupedWithMinMaxThresholds.dimensionalPriceConfiguration + licenseType = groupedWithMinMaxThresholds.licenseType additionalProperties = groupedWithMinMaxThresholds.additionalProperties.toMutableMap() } @@ -61745,6 +67990,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -61836,6 +68104,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -61879,6 +68148,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -61928,7 +68198,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -63321,6 +69592,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -63355,6 +69884,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -63388,6 +69918,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -63395,7 +69926,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class MatrixWithDisplayName @@ -63429,6 +69960,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -63505,6 +70037,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -63534,6 +70069,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -63736,6 +70272,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -63991,6 +70536,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -64073,6 +70627,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -64106,6 +70661,7 @@ private constructor( priceType = matrixWithDisplayName.priceType replacesPriceId = matrixWithDisplayName.replacesPriceId dimensionalPriceConfiguration = matrixWithDisplayName.dimensionalPriceConfiguration + licenseType = matrixWithDisplayName.licenseType additionalProperties = matrixWithDisplayName.additionalProperties.toMutableMap() } @@ -64736,6 +71292,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -64824,6 +71403,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -64867,6 +71447,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -64914,7 +71495,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -66486,6 +73068,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -66520,6 +73360,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -66553,6 +73394,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -66560,7 +73402,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithDisplayName{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "MatrixWithDisplayName{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class GroupedTieredPackage @@ -66594,6 +73436,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -66670,6 +73513,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -66699,6 +73545,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -66901,6 +73748,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -67156,6 +74012,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -67238,6 +74103,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -67271,6 +74137,7 @@ private constructor( priceType = groupedTieredPackage.priceType replacesPriceId = groupedTieredPackage.replacesPriceId dimensionalPriceConfiguration = groupedTieredPackage.dimensionalPriceConfiguration + licenseType = groupedTieredPackage.licenseType additionalProperties = groupedTieredPackage.additionalProperties.toMutableMap() } @@ -67900,6 +74767,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -67988,6 +74878,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -68031,6 +74922,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -68078,7 +74970,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -69642,6 +76535,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -69676,6 +76827,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -69709,6 +76861,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -69716,7 +76869,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "GroupedTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class MaxGroupTieredPackage @@ -69750,6 +76903,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -69826,6 +76980,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -69855,6 +77012,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -70057,6 +77215,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -70312,6 +77479,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -70394,6 +77570,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -70427,6 +77604,7 @@ private constructor( priceType = maxGroupTieredPackage.priceType replacesPriceId = maxGroupTieredPackage.replacesPriceId dimensionalPriceConfiguration = maxGroupTieredPackage.dimensionalPriceConfiguration + licenseType = maxGroupTieredPackage.licenseType additionalProperties = maxGroupTieredPackage.additionalProperties.toMutableMap() } @@ -71057,6 +78235,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -71145,6 +78346,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -71188,6 +78390,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -71235,7 +78438,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -72802,6 +80006,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -72836,6 +80298,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -72869,6 +80332,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -72876,7 +80340,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MaxGroupTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "MaxGroupTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class ScalableMatrixWithUnitPricing @@ -72911,6 +80375,7 @@ private constructor( private val scalableMatrixWithUnitPricingConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -72988,6 +80453,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -73017,6 +80485,7 @@ private constructor( replacesPriceId, scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -73221,6 +80690,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -73476,6 +80954,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -73561,6 +81048,7 @@ private constructor( null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -73601,6 +81089,7 @@ private constructor( scalableMatrixWithUnitPricing.scalableMatrixWithUnitPricingConfig dimensionalPriceConfiguration = scalableMatrixWithUnitPricing.dimensionalPriceConfiguration + licenseType = scalableMatrixWithUnitPricing.licenseType additionalProperties = scalableMatrixWithUnitPricing.additionalProperties.toMutableMap() } @@ -74237,6 +81726,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -74328,6 +81840,7 @@ private constructor( scalableMatrixWithUnitPricingConfig, ), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -74371,6 +81884,7 @@ private constructor( replacesPriceId() scalableMatrixWithUnitPricingConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -74420,7 +81934,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (scalableMatrixWithUnitPricingConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -76165,6 +83680,264 @@ private constructor( "ScalableMatrixWithUnitPricingConfig{firstDimension=$firstDimension, matrixScalingFactors=$matrixScalingFactors, unitPrice=$unitPrice, prorate=$prorate, secondDimension=$secondDimension, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -76199,6 +83972,7 @@ private constructor( replacesPriceId == other.replacesPriceId && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -76232,6 +84006,7 @@ private constructor( replacesPriceId, scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -76239,7 +84014,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ScalableMatrixWithUnitPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "ScalableMatrixWithUnitPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class ScalableMatrixWithTieredPricing @@ -76274,6 +84049,7 @@ private constructor( private val scalableMatrixWithTieredPricingConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -76352,6 +84128,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -76381,6 +84160,7 @@ private constructor( replacesPriceId, scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -76585,6 +84365,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -76840,6 +84629,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -76925,6 +84723,7 @@ private constructor( null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -76965,6 +84764,7 @@ private constructor( scalableMatrixWithTieredPricing.scalableMatrixWithTieredPricingConfig dimensionalPriceConfiguration = scalableMatrixWithTieredPricing.dimensionalPriceConfiguration + licenseType = scalableMatrixWithTieredPricing.licenseType additionalProperties = scalableMatrixWithTieredPricing.additionalProperties.toMutableMap() } @@ -77602,6 +85402,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -77693,6 +85516,7 @@ private constructor( scalableMatrixWithTieredPricingConfig, ), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -77736,6 +85560,7 @@ private constructor( replacesPriceId() scalableMatrixWithTieredPricingConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -77785,7 +85610,8 @@ private constructor( (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (scalableMatrixWithTieredPricingConfig.asKnown().getOrNull()?.validity() ?: 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -79698,6 +87524,264 @@ private constructor( "ScalableMatrixWithTieredPricingConfig{firstDimension=$firstDimension, matrixScalingFactors=$matrixScalingFactors, tiers=$tiers, secondDimension=$secondDimension, additionalProperties=$additionalProperties}" } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -79733,6 +87817,7 @@ private constructor( scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -79766,6 +87851,7 @@ private constructor( replacesPriceId, scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -79773,7 +87859,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ScalableMatrixWithTieredPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "ScalableMatrixWithTieredPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, replacesPriceId=$replacesPriceId, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class CumulativeGroupedBulk @@ -79807,6 +87893,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -79883,6 +87970,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -79912,6 +88002,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -80114,6 +88205,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -80369,6 +88469,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -80451,6 +88560,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -80484,6 +88594,7 @@ private constructor( priceType = cumulativeGroupedBulk.priceType replacesPriceId = cumulativeGroupedBulk.replacesPriceId dimensionalPriceConfiguration = cumulativeGroupedBulk.dimensionalPriceConfiguration + licenseType = cumulativeGroupedBulk.licenseType additionalProperties = cumulativeGroupedBulk.additionalProperties.toMutableMap() } @@ -81114,6 +89225,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -81202,6 +89336,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -81245,6 +89380,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -81292,7 +89428,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -82857,6 +90994,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -82891,6 +91286,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -82924,6 +91320,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -82931,7 +91328,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedBulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "CumulativeGroupedBulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, cumulativeGroupedBulkConfig=$cumulativeGroupedBulkConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -82965,6 +91362,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -83042,6 +91440,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -83071,6 +91472,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -83273,6 +91675,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -83528,6 +91939,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -83613,6 +92033,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -83649,6 +92070,7 @@ private constructor( replacesPriceId = cumulativeGroupedAllocation.replacesPriceId dimensionalPriceConfiguration = cumulativeGroupedAllocation.dimensionalPriceConfiguration + licenseType = cumulativeGroupedAllocation.licenseType additionalProperties = cumulativeGroupedAllocation.additionalProperties.toMutableMap() } @@ -84280,6 +92702,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -84371,6 +92816,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -84414,6 +92860,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -84463,7 +92910,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -85672,20 +94120,404 @@ private constructor( } /** - * Returns an immutable instance of [Metadata]. + * Returns an immutable instance of [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + + 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") + + @JvmField val COMPOSITE_PRICE = of("composite_price") + + @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + COMPOSITE_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, + COMPOSITE_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 + COMPOSITE_PRICE -> Value.COMPOSITE_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 + COMPOSITE_PRICE -> Known.COMPOSITE_PRICE + else -> throw OrbInvalidDataException("Unknown PriceType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): PriceType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PriceType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. * * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false - fun validate(): Metadata = apply { + fun validate(): LicenseType = apply { if (validated) { return@apply } + id() + groupingKey() + name() validated = true } @@ -85705,156 +94537,30 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Metadata && additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - } - - 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") - - @JvmField val COMPOSITE_PRICE = of("composite_price") - - @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) - } - - /** An enum containing [PriceType]'s known values. */ - enum class Known { - USAGE_PRICE, - FIXED_PRICE, - COMPOSITE_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, - COMPOSITE_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 - COMPOSITE_PRICE -> Value.COMPOSITE_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 - COMPOSITE_PRICE -> Known.COMPOSITE_PRICE - else -> throw OrbInvalidDataException("Unknown PriceType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws OrbInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } - - private var validated: Boolean = false - - fun validate(): PriceType = apply { - if (validated) { - return@apply - } - - known() - validated = true + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: OrbInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PriceType && value == other.value + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) } - override fun hashCode() = value.hashCode() + override fun hashCode(): Int = hashCode - override fun toString() = value.toString() + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -85891,6 +94597,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -85924,6 +94631,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -85931,7 +94639,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class MinimumComposite @@ -85965,6 +94673,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -86041,6 +94750,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -86070,6 +94782,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -86272,6 +94985,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -86526,6 +95248,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -86608,6 +95339,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -86641,6 +95373,7 @@ private constructor( priceType = minimumComposite.priceType replacesPriceId = minimumComposite.replacesPriceId dimensionalPriceConfiguration = minimumComposite.dimensionalPriceConfiguration + licenseType = minimumComposite.licenseType additionalProperties = minimumComposite.additionalProperties.toMutableMap() } @@ -87271,6 +96004,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -87359,6 +96115,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -87402,6 +96159,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -87449,7 +96207,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -88736,6 +97495,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -88770,6 +97787,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -88803,6 +97821,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -88810,7 +97829,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MinimumComposite{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "MinimumComposite{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, minimumCompositeConfig=$minimumCompositeConfig, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class Percent @@ -88844,6 +97863,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -88920,6 +97940,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -88949,6 +97972,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -89150,6 +98174,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -89404,6 +98437,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -89486,6 +98528,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -89518,6 +98561,7 @@ private constructor( priceType = percent.priceType replacesPriceId = percent.replacesPriceId dimensionalPriceConfiguration = percent.dimensionalPriceConfiguration + licenseType = percent.licenseType additionalProperties = percent.additionalProperties.toMutableMap() } @@ -90147,6 +99191,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -90235,6 +99302,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -90278,6 +99346,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -90325,7 +99394,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -91364,32 +100434,417 @@ private constructor( } /** - * Returns an immutable instance of [PercentConfig]. + * Returns an immutable instance of [PercentConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .percent() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PercentConfig = + PercentConfig( + checkRequired("percent", percent), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): PercentConfig = apply { + if (validated) { + return@apply + } + + percent() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (if (percent.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PercentConfig && + percent == other.percent && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(percent, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PercentConfig{percent=$percent, additionalProperties=$additionalProperties}" + } + + 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") + + @JvmField val COMPOSITE_PRICE = of("composite_price") + + @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + COMPOSITE_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, + COMPOSITE_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 + COMPOSITE_PRICE -> Value.COMPOSITE_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 + COMPOSITE_PRICE -> Known.COMPOSITE_PRICE + else -> throw OrbInvalidDataException("Unknown PriceType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OrbInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): PriceType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PriceType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .percent() + * .id() + * .groupingKey() + * .name() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): PercentConfig = - PercentConfig( - checkRequired("percent", percent), + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): PercentConfig = apply { + fun validate(): LicenseType = apply { if (validated) { return@apply } - percent() + id() + groupingKey() + name() validated = true } @@ -91407,159 +100862,32 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = (if (percent.asKnown().isPresent) 1 else 0) + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is PercentConfig && - percent == other.percent && + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(percent, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } override fun hashCode(): Int = hashCode override fun toString() = - "PercentConfig{percent=$percent, additionalProperties=$additionalProperties}" - } - - 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") - - @JvmField val COMPOSITE_PRICE = of("composite_price") - - @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) - } - - /** An enum containing [PriceType]'s known values. */ - enum class Known { - USAGE_PRICE, - FIXED_PRICE, - COMPOSITE_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, - COMPOSITE_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 - COMPOSITE_PRICE -> Value.COMPOSITE_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 - COMPOSITE_PRICE -> Known.COMPOSITE_PRICE - else -> throw OrbInvalidDataException("Unknown PriceType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws OrbInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") } - - private var validated: Boolean = false - - fun validate(): PriceType = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: OrbInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PriceType && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -91596,6 +100924,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -91629,6 +100958,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -91636,7 +100966,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, percentConfig=$percentConfig, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "Percent{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, 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, percentConfig=$percentConfig, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, additionalProperties=$additionalProperties}" } class EventOutput @@ -91670,6 +101000,7 @@ private constructor( private val priceType: JsonField, private val replacesPriceId: JsonField, private val dimensionalPriceConfiguration: JsonField, + private val licenseType: JsonField, private val additionalProperties: MutableMap, ) { @@ -91746,6 +101077,9 @@ private constructor( @ExcludeMissing dimensionalPriceConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type") + @ExcludeMissing + licenseType: JsonField = JsonMissing.of(), ) : this( id, billableMetric, @@ -91775,6 +101109,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, mutableMapOf(), ) @@ -91977,6 +101312,15 @@ private constructor( fun dimensionalPriceConfiguration(): Optional = dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseType(): Optional = licenseType.getOptional("license_type") + /** * Returns the raw JSON value of [id]. * @@ -92231,6 +101575,15 @@ private constructor( fun _dimensionalPriceConfiguration(): JsonField = dimensionalPriceConfiguration + /** + * Returns the raw JSON value of [licenseType]. + * + * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("license_type") + @ExcludeMissing + fun _licenseType(): JsonField = licenseType + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -92313,6 +101666,7 @@ private constructor( private var replacesPriceId: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() + private var licenseType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -92345,6 +101699,7 @@ private constructor( priceType = eventOutput.priceType replacesPriceId = eventOutput.replacesPriceId dimensionalPriceConfiguration = eventOutput.dimensionalPriceConfiguration + licenseType = eventOutput.licenseType additionalProperties = eventOutput.additionalProperties.toMutableMap() } @@ -92974,6 +102329,29 @@ private constructor( dimensionalPriceConfiguration: JsonField ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping + * key. + */ + fun licenseType(licenseType: LicenseType?) = + licenseType(JsonField.ofNullable(licenseType)) + + /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */ + fun licenseType(licenseType: Optional) = + licenseType(licenseType.getOrNull()) + + /** + * Sets [Builder.licenseType] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun licenseType(licenseType: JsonField) = apply { + this.licenseType = licenseType + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -93062,6 +102440,7 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), dimensionalPriceConfiguration, + licenseType, additionalProperties.toMutableMap(), ) } @@ -93105,6 +102484,7 @@ private constructor( priceType().validate() replacesPriceId() dimensionalPriceConfiguration().ifPresent { it.validate() } + licenseType().ifPresent { it.validate() } validated = true } @@ -93152,7 +102532,8 @@ private constructor( (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (licenseType.asKnown().getOrNull()?.validity() ?: 0) class BillingMode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -94506,6 +103887,264 @@ private constructor( override fun toString() = value.toString() } + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + class LicenseType + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val groupingKey: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("grouping_key") + @ExcludeMissing + groupingKey: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(id, groupingKey, name, mutableMapOf()) + + /** + * The Orb-assigned unique identifier for the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun id(): String = id.getRequired("id") + + /** + * The key used for grouping licenses of this type. This is typically a user identifier + * field. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun groupingKey(): String = groupingKey.getRequired("grouping_key") + + /** + * The name of the license type. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [groupingKey]. + * + * Unlike [groupingKey], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("grouping_key") + @ExcludeMissing + fun _groupingKey(): JsonField = groupingKey + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LicenseType]. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LicenseType]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var groupingKey: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(licenseType: LicenseType) = apply { + id = licenseType.id + groupingKey = licenseType.groupingKey + name = licenseType.name + additionalProperties = licenseType.additionalProperties.toMutableMap() + } + + /** The Orb-assigned unique identifier for the license type. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + fun groupingKey(groupingKey: String) = groupingKey(JsonField.of(groupingKey)) + + /** + * Sets [Builder.groupingKey] to an arbitrary JSON value. + * + * You should usually call [Builder.groupingKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun groupingKey(groupingKey: JsonField) = apply { + this.groupingKey = groupingKey + } + + /** The name of the license type. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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) + } + + /** + * Returns an immutable instance of [LicenseType]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .groupingKey() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LicenseType = + LicenseType( + checkRequired("id", id), + checkRequired("groupingKey", groupingKey), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LicenseType = apply { + if (validated) { + return@apply + } + + id() + groupingKey() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (groupingKey.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LicenseType && + id == other.id && + groupingKey == other.groupingKey && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, groupingKey, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LicenseType{id=$id, groupingKey=$groupingKey, name=$name, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -94540,6 +104179,7 @@ private constructor( priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && + licenseType == other.licenseType && additionalProperties == other.additionalProperties } @@ -94573,6 +104213,7 @@ private constructor( priceType, replacesPriceId, dimensionalPriceConfiguration, + licenseType, additionalProperties, ) } @@ -94580,6 +104221,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, eventOutputConfig=$eventOutputConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "EventOutput{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, eventOutputConfig=$eventOutputConfig, 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, replacesPriceId=$replacesPriceId, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, licenseType=$licenseType, 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 33805bc5d..4fa8d654e 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 @@ -1654,6 +1654,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -1707,6 +1708,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -1727,6 +1731,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -1881,6 +1886,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -2033,6 +2046,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -2095,6 +2118,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -2116,6 +2140,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() } @@ -2516,6 +2541,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -2591,6 +2635,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -2623,6 +2668,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -2659,6 +2705,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** Configuration for bulk_with_filters pricing */ @@ -3642,6 +3689,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -3664,6 +3712,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -3672,7 +3721,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -3695,6 +3744,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -3749,6 +3799,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -3769,6 +3822,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -3925,6 +3979,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -4078,6 +4140,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -4143,6 +4215,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -4169,6 +4242,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata additionalProperties = groupedWithMinMaxThresholds.additionalProperties.toMutableMap() @@ -4575,6 +4649,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -4653,6 +4746,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -4685,6 +4779,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -4723,6 +4818,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -5334,6 +5430,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -5356,6 +5453,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -5364,7 +5462,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -5387,6 +5485,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -5441,6 +5540,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -5461,6 +5563,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -5617,6 +5720,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -5770,6 +5881,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -5835,6 +5956,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -5861,6 +5983,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata additionalProperties = cumulativeGroupedAllocation.additionalProperties.toMutableMap() @@ -6267,6 +6390,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -6345,6 +6487,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -6377,6 +6520,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -6415,6 +6559,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -7034,6 +7179,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -7056,6 +7202,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -7064,7 +7211,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class Percent @@ -7086,6 +7233,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -7139,6 +7287,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -7159,6 +7310,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -7312,6 +7464,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7464,6 +7624,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7526,6 +7696,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7547,6 +7718,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata additionalProperties = percent.additionalProperties.toMutableMap() } @@ -7946,6 +8118,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -8021,6 +8212,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -8053,6 +8245,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -8089,6 +8282,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -8546,6 +8740,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -8568,6 +8763,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -8576,7 +8772,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class EventOutput @@ -8598,6 +8794,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -8651,6 +8848,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8671,6 +8871,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -8825,6 +9026,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -8977,6 +9186,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9039,6 +9258,7 @@ private constructor( private var invoiceGroupingKey: JsonField = JsonMissing.of() private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9060,6 +9280,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata additionalProperties = eventOutput.additionalProperties.toMutableMap() } @@ -9459,6 +9680,25 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9534,6 +9774,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -9566,6 +9807,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -9602,6 +9844,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -10176,6 +10419,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -10198,6 +10442,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -10206,7 +10451,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateMultipleParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateMultipleParams.kt index d92a665b7..1d535d053 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateMultipleParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateMultipleParams.kt @@ -817,6 +817,7 @@ private constructor( private val externalPriceId: JsonField, private val filter: JsonField, private val groupingKeys: JsonField>, + private val metricParameterOverrides: JsonField, private val price: JsonField, private val priceId: JsonField, private val additionalProperties: MutableMap, @@ -831,9 +832,20 @@ private constructor( @JsonProperty("grouping_keys") @ExcludeMissing groupingKeys: JsonField> = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of(), @JsonProperty("price_id") @ExcludeMissing priceId: JsonField = JsonMissing.of(), - ) : this(externalPriceId, filter, groupingKeys, price, priceId, mutableMapOf()) + ) : this( + externalPriceId, + filter, + groupingKeys, + metricParameterOverrides, + price, + priceId, + mutableMapOf(), + ) /** * The external ID of a price to evaluate that exists in your Orb account. @@ -862,6 +874,16 @@ private constructor( */ fun groupingKeys(): Optional> = groupingKeys.getOptional("grouping_keys") + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * New floating price request body params. * @@ -905,6 +927,17 @@ private constructor( @ExcludeMissing fun _groupingKeys(): JsonField> = groupingKeys + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [price]. * @@ -943,6 +976,8 @@ private constructor( private var externalPriceId: JsonField = JsonMissing.of() private var filter: JsonField = JsonMissing.of() private var groupingKeys: JsonField>? = null + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var price: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -952,6 +987,7 @@ private constructor( externalPriceId = priceEvaluation.externalPriceId filter = priceEvaluation.filter groupingKeys = priceEvaluation.groupingKeys.map { it.toMutableList() } + metricParameterOverrides = priceEvaluation.metricParameterOverrides price = priceEvaluation.price priceId = priceEvaluation.priceId additionalProperties = priceEvaluation.additionalProperties.toMutableMap() @@ -1024,6 +1060,32 @@ private constructor( } } + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** New floating price request body params. */ fun price(price: Price?) = price(JsonField.ofNullable(price)) @@ -1243,6 +1305,7 @@ private constructor( externalPriceId, filter, (groupingKeys ?: JsonMissing.of()).map { it.toImmutable() }, + metricParameterOverrides, price, priceId, additionalProperties.toMutableMap(), @@ -1259,6 +1322,7 @@ private constructor( externalPriceId() filter() groupingKeys() + metricParameterOverrides().ifPresent { it.validate() } price().ifPresent { it.validate() } priceId() validated = true @@ -1283,9 +1347,123 @@ private constructor( (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (filter.asKnown().isPresent) 1 else 0) + (groupingKeys.asKnown().getOrNull()?.size ?: 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New floating price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -2631,6 +2809,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -2688,6 +2867,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -2708,6 +2890,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -2866,6 +3049,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -3026,6 +3217,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -3090,6 +3291,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3112,6 +3314,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() } @@ -3523,6 +3726,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -3598,6 +3822,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -3630,6 +3855,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -3666,6 +3892,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** Configuration for bulk_with_filters pricing */ @@ -4662,6 +4889,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -4684,6 +4912,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -4692,7 +4921,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -4716,6 +4945,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -4775,6 +5005,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -4795,6 +5028,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -4955,6 +5189,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -5115,6 +5357,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -5183,6 +5435,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -5209,6 +5462,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata additionalProperties = groupedWithMinMaxThresholds.additionalProperties.toMutableMap() @@ -5629,6 +5883,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -5707,6 +5982,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -5739,6 +6015,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -5777,6 +6054,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -6398,6 +6676,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -6420,6 +6699,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -6428,7 +6708,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -6452,6 +6732,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -6511,6 +6792,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -6531,6 +6815,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -6691,6 +6976,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -6851,6 +7144,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -6919,6 +7222,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -6945,6 +7249,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata additionalProperties = cumulativeGroupedAllocation.additionalProperties.toMutableMap() @@ -7365,6 +7670,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -7443,6 +7769,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -7475,6 +7802,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -7513,6 +7841,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -8141,6 +8470,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -8163,6 +8493,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -8171,7 +8502,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class Percent @@ -8194,6 +8525,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -8251,6 +8583,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8271,6 +8606,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -8428,6 +8764,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -8587,6 +8931,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -8651,6 +9005,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -8672,6 +9027,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata additionalProperties = percent.additionalProperties.toMutableMap() } @@ -9083,6 +9439,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9158,6 +9535,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -9190,6 +9568,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -9226,6 +9605,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -9694,6 +10074,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -9716,6 +10097,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -9724,7 +10106,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class EventOutput @@ -9747,6 +10129,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -9804,6 +10187,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -9824,6 +10210,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -9982,6 +10369,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -10141,6 +10536,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -10205,6 +10610,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10226,6 +10632,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata additionalProperties = eventOutput.additionalProperties.toMutableMap() } @@ -10637,6 +11044,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -10712,6 +11140,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -10744,6 +11173,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -10780,6 +11210,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -11368,6 +11799,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -11390,6 +11822,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -11398,7 +11831,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } } @@ -11411,6 +11844,7 @@ private constructor( externalPriceId == other.externalPriceId && filter == other.filter && groupingKeys == other.groupingKeys && + metricParameterOverrides == other.metricParameterOverrides && price == other.price && priceId == other.priceId && additionalProperties == other.additionalProperties @@ -11421,6 +11855,7 @@ private constructor( externalPriceId, filter, groupingKeys, + metricParameterOverrides, price, priceId, additionalProperties, @@ -11430,7 +11865,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PriceEvaluation{externalPriceId=$externalPriceId, filter=$filter, groupingKeys=$groupingKeys, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" + "PriceEvaluation{externalPriceId=$externalPriceId, filter=$filter, groupingKeys=$groupingKeys, metricParameterOverrides=$metricParameterOverrides, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { 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 138089286..80cce7318 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 @@ -105,6 +105,16 @@ private constructor( */ fun groupingKeys(): Optional> = body.groupingKeys() + /** + * Optional overrides for parameterized billable metric parameters. If the metric has parameter + * definitions and no overrides are provided, defaults will be used. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + body.metricParameterOverrides() + /** * Returns the raw JSON value of [timeframeEnd]. * @@ -148,6 +158,15 @@ private constructor( */ fun _groupingKeys(): JsonField> = body._groupingKeys() + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _metricParameterOverrides(): JsonField = + body._metricParameterOverrides() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -316,6 +335,32 @@ private constructor( */ fun addGroupingKey(groupingKey: String) = apply { body.addGroupingKey(groupingKey) } + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = apply { + body.metricParameterOverrides(metricParameterOverrides) + } + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides(metricParameterOverrides: Optional) = + metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { body.metricParameterOverrides(metricParameterOverrides) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -476,6 +521,7 @@ private constructor( private val externalCustomerId: JsonField, private val filter: JsonField, private val groupingKeys: JsonField>, + private val metricParameterOverrides: JsonField, private val additionalProperties: MutableMap, ) { @@ -497,6 +543,9 @@ private constructor( @JsonProperty("grouping_keys") @ExcludeMissing groupingKeys: JsonField> = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), ) : this( timeframeEnd, timeframeStart, @@ -504,6 +553,7 @@ private constructor( externalCustomerId, filter, groupingKeys, + metricParameterOverrides, mutableMapOf(), ) @@ -559,6 +609,16 @@ private constructor( */ fun groupingKeys(): Optional> = groupingKeys.getOptional("grouping_keys") + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * Returns the raw JSON value of [timeframeEnd]. * @@ -615,6 +675,17 @@ private constructor( @ExcludeMissing fun _groupingKeys(): JsonField> = groupingKeys + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -650,6 +721,8 @@ private constructor( private var externalCustomerId: JsonField = JsonMissing.of() private var filter: JsonField = JsonMissing.of() private var groupingKeys: JsonField>? = null + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -660,6 +733,7 @@ private constructor( externalCustomerId = body.externalCustomerId filter = body.filter groupingKeys = body.groupingKeys.map { it.toMutableList() } + metricParameterOverrides = body.metricParameterOverrides additionalProperties = body.additionalProperties.toMutableMap() } @@ -778,6 +852,32 @@ private constructor( } } + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -818,6 +918,7 @@ private constructor( externalCustomerId, filter, (groupingKeys ?: JsonMissing.of()).map { it.toImmutable() }, + metricParameterOverrides, additionalProperties.toMutableMap(), ) } @@ -835,6 +936,7 @@ private constructor( externalCustomerId() filter() groupingKeys() + metricParameterOverrides().ifPresent { it.validate() } validated = true } @@ -859,7 +961,8 @@ private constructor( (if (customerId.asKnown().isPresent) 1 else 0) + (if (externalCustomerId.asKnown().isPresent) 1 else 0) + (if (filter.asKnown().isPresent) 1 else 0) + - (groupingKeys.asKnown().getOrNull()?.size ?: 0) + (groupingKeys.asKnown().getOrNull()?.size ?: 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -873,6 +976,7 @@ private constructor( externalCustomerId == other.externalCustomerId && filter == other.filter && groupingKeys == other.groupingKeys && + metricParameterOverrides == other.metricParameterOverrides && additionalProperties == other.additionalProperties } @@ -884,6 +988,7 @@ private constructor( externalCustomerId, filter, groupingKeys, + metricParameterOverrides, additionalProperties, ) } @@ -891,7 +996,115 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{timeframeEnd=$timeframeEnd, timeframeStart=$timeframeStart, customerId=$customerId, externalCustomerId=$externalCustomerId, filter=$filter, groupingKeys=$groupingKeys, additionalProperties=$additionalProperties}" + "Body{timeframeEnd=$timeframeEnd, timeframeStart=$timeframeStart, customerId=$customerId, externalCustomerId=$externalCustomerId, filter=$filter, groupingKeys=$groupingKeys, metricParameterOverrides=$metricParameterOverrides, additionalProperties=$additionalProperties}" + } + + /** + * Optional overrides for parameterized billable metric parameters. If the metric has parameter + * definitions and no overrides are provided, defaults will be used. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParams.kt index 21999d6ba..4a46c25d7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParams.kt @@ -1367,6 +1367,7 @@ private constructor( private val externalPriceId: JsonField, private val filter: JsonField, private val groupingKeys: JsonField>, + private val metricParameterOverrides: JsonField, private val price: JsonField, private val priceId: JsonField, private val additionalProperties: MutableMap, @@ -1381,9 +1382,20 @@ private constructor( @JsonProperty("grouping_keys") @ExcludeMissing groupingKeys: JsonField> = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of(), @JsonProperty("price_id") @ExcludeMissing priceId: JsonField = JsonMissing.of(), - ) : this(externalPriceId, filter, groupingKeys, price, priceId, mutableMapOf()) + ) : this( + externalPriceId, + filter, + groupingKeys, + metricParameterOverrides, + price, + priceId, + mutableMapOf(), + ) /** * The external ID of a price to evaluate that exists in your Orb account. @@ -1412,6 +1424,16 @@ private constructor( */ fun groupingKeys(): Optional> = groupingKeys.getOptional("grouping_keys") + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * New floating price request body params. * @@ -1455,6 +1477,17 @@ private constructor( @ExcludeMissing fun _groupingKeys(): JsonField> = groupingKeys + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [price]. * @@ -1493,6 +1526,8 @@ private constructor( private var externalPriceId: JsonField = JsonMissing.of() private var filter: JsonField = JsonMissing.of() private var groupingKeys: JsonField>? = null + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var price: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1502,6 +1537,7 @@ private constructor( externalPriceId = priceEvaluation.externalPriceId filter = priceEvaluation.filter groupingKeys = priceEvaluation.groupingKeys.map { it.toMutableList() } + metricParameterOverrides = priceEvaluation.metricParameterOverrides price = priceEvaluation.price priceId = priceEvaluation.priceId additionalProperties = priceEvaluation.additionalProperties.toMutableMap() @@ -1574,6 +1610,32 @@ private constructor( } } + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** New floating price request body params. */ fun price(price: Price?) = price(JsonField.ofNullable(price)) @@ -1793,6 +1855,7 @@ private constructor( externalPriceId, filter, (groupingKeys ?: JsonMissing.of()).map { it.toImmutable() }, + metricParameterOverrides, price, priceId, additionalProperties.toMutableMap(), @@ -1809,6 +1872,7 @@ private constructor( externalPriceId() filter() groupingKeys() + metricParameterOverrides().ifPresent { it.validate() } price().ifPresent { it.validate() } priceId() validated = true @@ -1833,9 +1897,123 @@ private constructor( (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (filter.asKnown().isPresent) 1 else 0) + (groupingKeys.asKnown().getOrNull()?.size ?: 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + /** + * Optional overrides for parameterized billable metric parameters. If the metric has + * parameter definitions and no overrides are provided, defaults will be used. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New floating price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -3181,6 +3359,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -3238,6 +3417,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -3258,6 +3440,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -3416,6 +3599,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -3576,6 +3767,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -3640,6 +3841,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3662,6 +3864,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() } @@ -4073,6 +4276,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -4148,6 +4372,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -4180,6 +4405,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -4216,6 +4442,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** Configuration for bulk_with_filters pricing */ @@ -5212,6 +5439,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -5234,6 +5462,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -5242,7 +5471,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -5266,6 +5495,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -5325,6 +5555,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -5345,6 +5578,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -5505,6 +5739,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -5665,6 +5907,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -5733,6 +5985,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -5759,6 +6012,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata additionalProperties = groupedWithMinMaxThresholds.additionalProperties.toMutableMap() @@ -6179,6 +6433,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -6257,6 +6532,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -6289,6 +6565,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -6327,6 +6604,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -6948,6 +7226,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -6970,6 +7249,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -6978,7 +7258,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -7002,6 +7282,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -7061,6 +7342,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -7081,6 +7365,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -7241,6 +7526,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7401,6 +7694,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7469,6 +7772,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7495,6 +7799,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata additionalProperties = cumulativeGroupedAllocation.additionalProperties.toMutableMap() @@ -7915,6 +8220,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -7993,6 +8319,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -8025,6 +8352,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -8063,6 +8391,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -8691,6 +9020,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -8713,6 +9043,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -8721,7 +9052,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class Percent @@ -8744,6 +9075,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -8801,6 +9133,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8821,6 +9156,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -8978,6 +9314,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -9137,6 +9481,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9201,6 +9555,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9222,6 +9577,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata additionalProperties = percent.additionalProperties.toMutableMap() } @@ -9633,6 +9989,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9708,6 +10085,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -9740,6 +10118,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -9776,6 +10155,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -10244,6 +10624,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -10266,6 +10647,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -10274,7 +10656,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class EventOutput @@ -10297,6 +10679,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -10354,6 +10737,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -10374,6 +10760,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -10532,6 +10919,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -10691,6 +11086,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -10755,6 +11160,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10776,6 +11182,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata additionalProperties = eventOutput.additionalProperties.toMutableMap() } @@ -11187,6 +11594,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -11262,6 +11690,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -11294,6 +11723,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -11330,6 +11760,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -11918,6 +12349,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -11940,6 +12372,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -11948,7 +12381,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } } @@ -11961,6 +12394,7 @@ private constructor( externalPriceId == other.externalPriceId && filter == other.filter && groupingKeys == other.groupingKeys && + metricParameterOverrides == other.metricParameterOverrides && price == other.price && priceId == other.priceId && additionalProperties == other.additionalProperties @@ -11971,6 +12405,7 @@ private constructor( externalPriceId, filter, groupingKeys, + metricParameterOverrides, price, priceId, additionalProperties, @@ -11980,7 +12415,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PriceEvaluation{externalPriceId=$externalPriceId, filter=$filter, groupingKeys=$groupingKeys, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" + "PriceEvaluation{externalPriceId=$externalPriceId, filter=$filter, groupingKeys=$groupingKeys, metricParameterOverrides=$metricParameterOverrides, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceInterval.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceInterval.kt index 370d06454..3b0178ed2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceInterval.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceInterval.kt @@ -38,6 +38,7 @@ private constructor( private val price: JsonField, private val startDate: JsonField, private val usageCustomerIds: JsonField>, + private val metricParameterOverrides: JsonField, private val additionalProperties: MutableMap, ) { @@ -70,6 +71,9 @@ private constructor( @JsonProperty("usage_customer_ids") @ExcludeMissing usageCustomerIds: JsonField> = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), ) : this( id, billingCycleDay, @@ -82,6 +86,7 @@ private constructor( price, startDate, usageCustomerIds, + metricParameterOverrides, mutableMapOf(), ) @@ -192,6 +197,16 @@ private constructor( fun usageCustomerIds(): Optional> = usageCustomerIds.getOptional("usage_customer_ids") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, values + * are the override values. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * Returns the raw JSON value of [id]. * @@ -288,6 +303,16 @@ private constructor( @ExcludeMissing fun _usageCustomerIds(): JsonField> = usageCustomerIds + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = metricParameterOverrides + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -339,6 +364,7 @@ private constructor( private var price: JsonField? = null private var startDate: JsonField? = null private var usageCustomerIds: JsonField>? = null + private var metricParameterOverrides: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -355,6 +381,7 @@ private constructor( price = priceInterval.price startDate = priceInterval.startDate usageCustomerIds = priceInterval.usageCustomerIds.map { it.toMutableList() } + metricParameterOverrides = priceInterval.metricParameterOverrides additionalProperties = priceInterval.additionalProperties.toMutableMap() } @@ -744,6 +771,31 @@ private constructor( } } + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides(metricParameterOverrides: Optional) = + metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -800,6 +852,7 @@ private constructor( checkRequired("price", price), checkRequired("startDate", startDate), checkRequired("usageCustomerIds", usageCustomerIds).map { it.toImmutable() }, + metricParameterOverrides, additionalProperties.toMutableMap(), ) } @@ -822,6 +875,7 @@ private constructor( price().validate() startDate() usageCustomerIds() + metricParameterOverrides().ifPresent { it.validate() } validated = true } @@ -851,7 +905,116 @@ private constructor( ?: 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (startDate.asKnown().isPresent) 1 else 0) + - (usageCustomerIds.asKnown().getOrNull()?.size ?: 0) + (usageCustomerIds.asKnown().getOrNull()?.size ?: 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Override values for parameterized billable metric variables. Keys are parameter names, values + * are the override values. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -870,6 +1033,7 @@ private constructor( price == other.price && startDate == other.startDate && usageCustomerIds == other.usageCustomerIds && + metricParameterOverrides == other.metricParameterOverrides && additionalProperties == other.additionalProperties } @@ -886,6 +1050,7 @@ private constructor( price, startDate, usageCustomerIds, + metricParameterOverrides, additionalProperties, ) } @@ -893,5 +1058,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PriceInterval{id=$id, billingCycleDay=$billingCycleDay, canDeferBilling=$canDeferBilling, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, endDate=$endDate, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, price=$price, startDate=$startDate, usageCustomerIds=$usageCustomerIds, additionalProperties=$additionalProperties}" + "PriceInterval{id=$id, billingCycleDay=$billingCycleDay, canDeferBilling=$canDeferBilling, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, endDate=$endDate, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, price=$price, startDate=$startDate, usageCustomerIds=$usageCustomerIds, metricParameterOverrides=$metricParameterOverrides, additionalProperties=$additionalProperties}" } 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 bcb06988b..0b54f5ad4 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 @@ -4477,6 +4477,7 @@ private constructor( private val endDate: JsonField, private val externalPriceId: JsonField, private val maximumAmount: JsonField, + private val metricParameterOverrides: JsonField, private val minimumAmount: JsonField, private val planPhaseOrder: JsonField, private val price: JsonField, @@ -4502,6 +4503,9 @@ private constructor( @JsonProperty("maximum_amount") @ExcludeMissing maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("minimum_amount") @ExcludeMissing minimumAmount: JsonField = JsonMissing.of(), @@ -4519,6 +4523,7 @@ private constructor( endDate, externalPriceId, maximumAmount, + metricParameterOverrides, minimumAmount, planPhaseOrder, price, @@ -4572,6 +4577,16 @@ private constructor( @Deprecated("deprecated") fun maximumAmount(): Optional = maximumAmount.getOptional("maximum_amount") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. @@ -4665,6 +4680,17 @@ private constructor( @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [minimumAmount]. * @@ -4735,6 +4761,8 @@ private constructor( private var endDate: JsonField = JsonMissing.of() private var externalPriceId: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var planPhaseOrder: JsonField = JsonMissing.of() private var price: JsonField = JsonMissing.of() @@ -4749,6 +4777,7 @@ private constructor( endDate = addPrice.endDate externalPriceId = addPrice.externalPriceId maximumAmount = addPrice.maximumAmount + metricParameterOverrides = addPrice.metricParameterOverrides minimumAmount = addPrice.minimumAmount planPhaseOrder = addPrice.planPhaseOrder price = addPrice.price @@ -4876,6 +4905,32 @@ private constructor( this.maximumAmount = maximumAmount } + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. @@ -5169,6 +5224,7 @@ private constructor( endDate, externalPriceId, maximumAmount, + metricParameterOverrides, minimumAmount, planPhaseOrder, price, @@ -5190,6 +5246,7 @@ private constructor( endDate() externalPriceId() maximumAmount() + metricParameterOverrides().ifPresent { it.validate() } minimumAmount() planPhaseOrder() price().ifPresent { it.validate() } @@ -5219,12 +5276,126 @@ private constructor( (if (endDate.asKnown().isPresent) 1 else 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + (if (startDate.asKnown().isPresent) 1 else 0) + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New subscription price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -6594,6 +6765,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -6652,6 +6824,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -6675,6 +6850,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -6834,6 +7010,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7003,6 +7187,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7076,6 +7270,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7099,6 +7294,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -7517,6 +7713,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -7613,6 +7830,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -7646,6 +7864,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -7683,6 +7902,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -8680,6 +8900,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -8703,6 +8924,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -8712,7 +8934,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -8735,6 +8957,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -8794,6 +9017,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8817,6 +9043,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -8976,6 +9203,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -9145,6 +9380,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9220,6 +9465,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9244,6 +9490,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -9664,6 +9911,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9760,6 +10028,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -9793,6 +10062,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -9832,6 +10102,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -10546,6 +10817,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -10569,6 +10841,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -10578,7 +10851,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -10602,6 +10875,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -10662,6 +10936,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -10685,6 +10962,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -10846,6 +11124,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -11015,6 +11301,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -11092,6 +11388,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -11119,6 +11416,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -11546,6 +11844,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -11645,6 +11964,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -11678,6 +11998,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -11717,6 +12038,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -12339,6 +12661,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -12362,6 +12685,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -12371,7 +12695,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -12395,6 +12719,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -12455,6 +12780,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -12478,6 +12806,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -12639,6 +12968,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -12808,6 +13145,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -12885,6 +13232,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -12912,6 +13260,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -13339,6 +13688,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -13438,6 +13808,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -13471,6 +13842,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -13510,6 +13882,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -14139,6 +14512,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -14162,6 +14536,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -14171,7 +14546,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -14194,6 +14569,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -14252,6 +14628,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -14275,6 +14654,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -14433,6 +14813,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -14601,6 +14989,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -14674,6 +15072,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -14696,6 +15095,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -15114,6 +15514,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -15210,6 +15631,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -15243,6 +15665,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -15280,6 +15703,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -15749,6 +16173,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -15772,6 +16197,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -15781,7 +16207,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -15804,6 +16230,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -15862,6 +16289,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -15885,6 +16315,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -16044,6 +16475,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -16212,6 +16651,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -16285,6 +16734,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -16307,6 +16757,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -16725,6 +17176,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -16821,6 +17293,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -16854,6 +17327,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -16891,6 +17365,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -17480,6 +17955,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -17503,6 +17979,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -17512,7 +17989,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } @@ -17527,6 +18004,7 @@ private constructor( endDate == other.endDate && externalPriceId == other.externalPriceId && maximumAmount == other.maximumAmount && + metricParameterOverrides == other.metricParameterOverrides && minimumAmount == other.minimumAmount && planPhaseOrder == other.planPhaseOrder && price == other.price && @@ -17542,6 +18020,7 @@ private constructor( endDate, externalPriceId, maximumAmount, + metricParameterOverrides, minimumAmount, planPhaseOrder, price, @@ -17554,7 +18033,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AddPrice{allocationPrice=$allocationPrice, discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, price=$price, priceId=$priceId, startDate=$startDate, additionalProperties=$additionalProperties}" + "AddPrice{allocationPrice=$allocationPrice, discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, maximumAmount=$maximumAmount, metricParameterOverrides=$metricParameterOverrides, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, price=$price, priceId=$priceId, startDate=$startDate, additionalProperties=$additionalProperties}" } @Deprecated("deprecated") @@ -18741,6 +19220,7 @@ private constructor( private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, private val maximumAmount: JsonField, + private val metricParameterOverrides: JsonField, private val minimumAmount: JsonField, private val price: JsonField, private val priceId: JsonField, @@ -18767,6 +19247,9 @@ private constructor( @JsonProperty("maximum_amount") @ExcludeMissing maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("minimum_amount") @ExcludeMissing minimumAmount: JsonField = JsonMissing.of(), @@ -18779,6 +19262,7 @@ private constructor( externalPriceId, fixedPriceQuantity, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -18839,6 +19323,16 @@ private constructor( @Deprecated("deprecated") fun maximumAmount(): Optional = maximumAmount.getOptional("maximum_amount") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. @@ -18926,6 +19420,17 @@ private constructor( @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [minimumAmount]. * @@ -18985,6 +19490,8 @@ private constructor( private var externalPriceId: JsonField = JsonMissing.of() private var fixedPriceQuantity: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var price: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() @@ -18998,6 +19505,7 @@ private constructor( externalPriceId = replacePrice.externalPriceId fixedPriceQuantity = replacePrice.fixedPriceQuantity maximumAmount = replacePrice.maximumAmount + metricParameterOverrides = replacePrice.metricParameterOverrides minimumAmount = replacePrice.minimumAmount price = replacePrice.price priceId = replacePrice.priceId @@ -19150,6 +19658,32 @@ private constructor( this.maximumAmount = maximumAmount } + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. @@ -19404,6 +19938,7 @@ private constructor( externalPriceId, fixedPriceQuantity, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -19424,6 +19959,7 @@ private constructor( externalPriceId() fixedPriceQuantity() maximumAmount() + metricParameterOverrides().ifPresent { it.validate() } minimumAmount() price().ifPresent { it.validate() } priceId() @@ -19452,10 +19988,124 @@ private constructor( (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New subscription price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -20825,6 +21475,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -20883,6 +21534,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -20906,6 +21560,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -21065,6 +21720,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -21234,6 +21897,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -21307,6 +21980,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -21330,6 +22004,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -21748,6 +22423,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -21844,6 +22540,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -21877,6 +22574,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -21914,6 +22612,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -22911,6 +23610,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -22934,6 +23634,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -22943,7 +23644,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -22966,6 +23667,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -23025,6 +23727,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -23048,6 +23753,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -23207,6 +23913,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -23376,6 +24090,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -23451,6 +24175,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -23475,6 +24200,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -23895,6 +24621,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -23991,6 +24738,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -24024,6 +24772,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -24063,6 +24812,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -24777,6 +25527,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -24800,6 +25551,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -24809,7 +25561,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -24833,6 +25585,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -24893,6 +25646,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -24916,6 +25672,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -25077,6 +25834,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -25246,6 +26011,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -25323,6 +26098,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -25350,6 +26126,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -25777,6 +26554,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -25876,6 +26674,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -25909,6 +26708,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -25948,6 +26748,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -26570,6 +27371,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -26593,6 +27395,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -26602,7 +27405,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -26626,6 +27429,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -26686,6 +27490,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -26709,6 +27516,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -26870,6 +27678,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -27039,6 +27855,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -27116,6 +27942,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -27143,6 +27970,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -27570,6 +28398,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -27669,6 +28518,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -27702,6 +28552,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -27741,6 +28592,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -28370,6 +29222,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -28393,6 +29246,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -28402,7 +29256,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -28425,6 +29279,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -28483,6 +29338,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -28506,6 +29364,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -28664,6 +29523,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -28832,6 +29699,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -28905,6 +29782,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -28927,6 +29805,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -29345,6 +30224,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -29441,6 +30341,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -29474,6 +30375,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -29511,6 +30413,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -29980,6 +30883,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -30003,6 +30907,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -30012,7 +30917,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -30035,6 +30940,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -30093,6 +30999,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -30116,6 +31025,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -30275,6 +31185,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -30443,6 +31361,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -30516,6 +31444,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -30538,6 +31467,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -30956,6 +31886,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -31052,6 +32003,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -31085,6 +32037,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -31122,6 +32075,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -31711,6 +32665,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -31734,6 +32689,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -31743,7 +32699,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } @@ -31759,6 +32715,7 @@ private constructor( externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && maximumAmount == other.maximumAmount && + metricParameterOverrides == other.metricParameterOverrides && minimumAmount == other.minimumAmount && price == other.price && priceId == other.priceId && @@ -31773,6 +32730,7 @@ private constructor( externalPriceId, fixedPriceQuantity, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -31783,7 +32741,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ReplacePrice{replacesPriceId=$replacesPriceId, allocationPrice=$allocationPrice, discounts=$discounts, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" + "ReplacePrice{replacesPriceId=$replacesPriceId, allocationPrice=$allocationPrice, discounts=$discounts, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, maximumAmount=$maximumAmount, metricParameterOverrides=$metricParameterOverrides, minimumAmount=$minimumAmount, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { 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 78a8ddd69..4df68c899 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 @@ -1027,6 +1027,7 @@ private constructor( private val filter: JsonField, private val fixedFeeQuantityTransitions: JsonField>, private val maximumAmount: JsonField, + private val metricParameterOverrides: JsonField, private val minimumAmount: JsonField, private val price: JsonField, private val priceId: JsonField, @@ -1062,6 +1063,9 @@ private constructor( @JsonProperty("maximum_amount") @ExcludeMissing maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("minimum_amount") @ExcludeMissing minimumAmount: JsonField = JsonMissing.of(), @@ -1080,6 +1084,7 @@ private constructor( filter, fixedFeeQuantityTransitions, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -1167,6 +1172,16 @@ private constructor( */ fun maximumAmount(): Optional = maximumAmount.getOptional("maximum_amount") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values (number or string). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * The minimum amount that will be billed for this price interval for a given billing * period. @@ -1288,6 +1303,17 @@ private constructor( @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [minimumAmount]. * @@ -1361,6 +1387,8 @@ private constructor( JsonField>? = null private var maximumAmount: JsonField = JsonMissing.of() + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var price: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() @@ -1379,6 +1407,7 @@ private constructor( fixedFeeQuantityTransitions = add.fixedFeeQuantityTransitions.map { it.toMutableList() } maximumAmount = add.maximumAmount + metricParameterOverrides = add.metricParameterOverrides minimumAmount = add.minimumAmount price = add.price priceId = add.priceId @@ -1672,6 +1701,32 @@ private constructor( this.maximumAmount = maximumAmount } + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values (number or string). + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** * The minimum amount that will be billed for this price interval for a given billing * period. @@ -1973,6 +2028,7 @@ private constructor( filter, (fixedFeeQuantityTransitions ?: JsonMissing.of()).map { it.toImmutable() }, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -1997,6 +2053,7 @@ private constructor( filter() fixedFeeQuantityTransitions().ifPresent { it.forEach { it.validate() } } maximumAmount() + metricParameterOverrides().ifPresent { it.validate() } minimumAmount() price().ifPresent { it.validate() } priceId() @@ -2030,6 +2087,7 @@ private constructor( (fixedFeeQuantityTransitions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + @@ -3489,6 +3547,119 @@ private constructor( "FixedFeeQuantityTransition{effectiveDate=$effectiveDate, quantity=$quantity, additionalProperties=$additionalProperties}" } + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values (number or string). + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New floating price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -4834,6 +5005,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -4891,6 +5063,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -4911,6 +5086,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -5069,6 +5245,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -5229,6 +5413,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -5293,6 +5487,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -5315,6 +5510,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() } @@ -5726,6 +5922,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -5801,6 +6018,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -5833,6 +6051,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -5869,6 +6088,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** Configuration for bulk_with_filters pricing */ @@ -6865,6 +7085,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -6887,6 +7108,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -6895,7 +7117,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -6919,6 +7141,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -6978,6 +7201,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -6998,6 +7224,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -7158,6 +7385,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -7318,6 +7553,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -7386,6 +7631,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7412,6 +7658,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata additionalProperties = groupedWithMinMaxThresholds.additionalProperties.toMutableMap() @@ -7832,6 +8079,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -7910,6 +8178,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -7942,6 +8211,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -7980,6 +8250,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -8601,6 +8872,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -8623,6 +8895,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -8631,7 +8904,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, currency=$currency, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -8655,6 +8928,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -8714,6 +8988,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8734,6 +9011,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -8894,6 +9172,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -9054,6 +9340,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -9122,6 +9418,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9148,6 +9445,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata additionalProperties = cumulativeGroupedAllocation.additionalProperties.toMutableMap() @@ -9568,6 +9866,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9646,6 +9965,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -9678,6 +9998,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -9716,6 +10037,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -10344,6 +10666,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -10366,6 +10689,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -10374,7 +10698,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class Percent @@ -10397,6 +10721,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -10454,6 +10779,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -10474,6 +10802,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -10631,6 +10960,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -10790,6 +11127,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -10854,6 +11201,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10875,6 +11223,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata additionalProperties = percent.additionalProperties.toMutableMap() } @@ -11286,6 +11635,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -11361,6 +11731,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -11393,6 +11764,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -11429,6 +11801,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -11897,6 +12270,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -11919,6 +12293,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -11927,7 +12302,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } class EventOutput @@ -11950,6 +12325,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -12007,6 +12383,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -12027,6 +12406,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, mutableMapOf(), ) @@ -12185,6 +12565,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -12344,6 +12732,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -12408,6 +12806,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -12429,6 +12828,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata additionalProperties = eventOutput.additionalProperties.toMutableMap() } @@ -12840,6 +13240,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -12915,6 +13336,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties.toMutableMap(), ) @@ -12947,6 +13369,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } validated = true } @@ -12983,6 +13406,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) /** The cadence to bill for this price on. */ @@ -13571,6 +13995,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && additionalProperties == other.additionalProperties } @@ -13593,6 +14018,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, additionalProperties, ) @@ -13601,7 +14027,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, currency=$currency, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, additionalProperties=$additionalProperties}" } } @@ -13620,6 +14046,7 @@ private constructor( filter == other.filter && fixedFeeQuantityTransitions == other.fixedFeeQuantityTransitions && maximumAmount == other.maximumAmount && + metricParameterOverrides == other.metricParameterOverrides && minimumAmount == other.minimumAmount && price == other.price && priceId == other.priceId && @@ -13638,6 +14065,7 @@ private constructor( filter, fixedFeeQuantityTransitions, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -13649,7 +14077,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Add{startDate=$startDate, allocationPrice=$allocationPrice, canDeferBilling=$canDeferBilling, discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, price=$price, priceId=$priceId, usageCustomerIds=$usageCustomerIds, additionalProperties=$additionalProperties}" + "Add{startDate=$startDate, allocationPrice=$allocationPrice, canDeferBilling=$canDeferBilling, discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, maximumAmount=$maximumAmount, metricParameterOverrides=$metricParameterOverrides, minimumAmount=$minimumAmount, price=$price, priceId=$priceId, usageCustomerIds=$usageCustomerIds, additionalProperties=$additionalProperties}" } class AddAdjustment @@ -14737,6 +15165,7 @@ private constructor( private val endDate: JsonField, private val filter: JsonField, private val fixedFeeQuantityTransitions: JsonField>, + private val metricParameterOverrides: JsonField, private val startDate: JsonField, private val usageCustomerIds: JsonField>, private val additionalProperties: MutableMap, @@ -14761,6 +15190,9 @@ private constructor( @ExcludeMissing fixedFeeQuantityTransitions: JsonField> = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("start_date") @ExcludeMissing startDate: JsonField = JsonMissing.of(), @@ -14774,6 +15206,7 @@ private constructor( endDate, filter, fixedFeeQuantityTransitions, + metricParameterOverrides, startDate, usageCustomerIds, mutableMapOf(), @@ -14835,6 +15268,16 @@ private constructor( fun fixedFeeQuantityTransitions(): Optional> = fixedFeeQuantityTransitions.getOptional("fixed_fee_quantity_transitions") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values (number or string). + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * The updated start date of this price interval. If not specified, the start date will not * be updated. @@ -14912,6 +15355,17 @@ private constructor( fun _fixedFeeQuantityTransitions(): JsonField> = fixedFeeQuantityTransitions + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [startDate]. * @@ -14967,6 +15421,8 @@ private constructor( private var fixedFeeQuantityTransitions: JsonField>? = null + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var startDate: JsonField = JsonMissing.of() private var usageCustomerIds: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -14980,6 +15436,7 @@ private constructor( filter = edit.filter fixedFeeQuantityTransitions = edit.fixedFeeQuantityTransitions.map { it.toMutableList() } + metricParameterOverrides = edit.metricParameterOverrides startDate = edit.startDate usageCustomerIds = edit.usageCustomerIds.map { it.toMutableList() } additionalProperties = edit.additionalProperties.toMutableMap() @@ -15154,6 +15611,32 @@ private constructor( } } + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values (number or string). + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** * The updated start date of this price interval. If not specified, the start date will * not be updated. @@ -15258,6 +15741,7 @@ private constructor( endDate, filter, (fixedFeeQuantityTransitions ?: JsonMissing.of()).map { it.toImmutable() }, + metricParameterOverrides, startDate, (usageCustomerIds ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), @@ -15277,6 +15761,7 @@ private constructor( endDate().ifPresent { it.validate() } filter() fixedFeeQuantityTransitions().ifPresent { it.forEach { it.validate() } } + metricParameterOverrides().ifPresent { it.validate() } startDate().ifPresent { it.validate() } usageCustomerIds() validated = true @@ -15305,6 +15790,7 @@ private constructor( (if (filter.asKnown().isPresent) 1 else 0) + (fixedFeeQuantityTransitions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (startDate.asKnown().getOrNull()?.validity() ?: 0) + (usageCustomerIds.asKnown().getOrNull()?.size ?: 0) @@ -15714,6 +16200,119 @@ private constructor( "FixedFeeQuantityTransition{effectiveDate=$effectiveDate, quantity=$quantity, additionalProperties=$additionalProperties}" } + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values (number or string). + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** * The updated start date of this price interval. If not specified, the start date will not * be updated. @@ -15914,6 +16513,7 @@ private constructor( endDate == other.endDate && filter == other.filter && fixedFeeQuantityTransitions == other.fixedFeeQuantityTransitions && + metricParameterOverrides == other.metricParameterOverrides && startDate == other.startDate && usageCustomerIds == other.usageCustomerIds && additionalProperties == other.additionalProperties @@ -15927,6 +16527,7 @@ private constructor( endDate, filter, fixedFeeQuantityTransitions, + metricParameterOverrides, startDate, usageCustomerIds, additionalProperties, @@ -15936,7 +16537,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Edit{priceIntervalId=$priceIntervalId, billingCycleDay=$billingCycleDay, canDeferBilling=$canDeferBilling, endDate=$endDate, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, startDate=$startDate, usageCustomerIds=$usageCustomerIds, additionalProperties=$additionalProperties}" + "Edit{priceIntervalId=$priceIntervalId, billingCycleDay=$billingCycleDay, canDeferBilling=$canDeferBilling, endDate=$endDate, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, metricParameterOverrides=$metricParameterOverrides, startDate=$startDate, usageCustomerIds=$usageCustomerIds, additionalProperties=$additionalProperties}" } class EditAdjustment 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 937589fde..4f6a250e0 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 @@ -4081,6 +4081,7 @@ private constructor( private val endDate: JsonField, private val externalPriceId: JsonField, private val maximumAmount: JsonField, + private val metricParameterOverrides: JsonField, private val minimumAmount: JsonField, private val planPhaseOrder: JsonField, private val price: JsonField, @@ -4106,6 +4107,9 @@ private constructor( @JsonProperty("maximum_amount") @ExcludeMissing maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("minimum_amount") @ExcludeMissing minimumAmount: JsonField = JsonMissing.of(), @@ -4123,6 +4127,7 @@ private constructor( endDate, externalPriceId, maximumAmount, + metricParameterOverrides, minimumAmount, planPhaseOrder, price, @@ -4176,6 +4181,16 @@ private constructor( @Deprecated("deprecated") fun maximumAmount(): Optional = maximumAmount.getOptional("maximum_amount") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. @@ -4269,6 +4284,17 @@ private constructor( @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [minimumAmount]. * @@ -4339,6 +4365,8 @@ private constructor( private var endDate: JsonField = JsonMissing.of() private var externalPriceId: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var planPhaseOrder: JsonField = JsonMissing.of() private var price: JsonField = JsonMissing.of() @@ -4353,6 +4381,7 @@ private constructor( endDate = addPrice.endDate externalPriceId = addPrice.externalPriceId maximumAmount = addPrice.maximumAmount + metricParameterOverrides = addPrice.metricParameterOverrides minimumAmount = addPrice.minimumAmount planPhaseOrder = addPrice.planPhaseOrder price = addPrice.price @@ -4480,6 +4509,32 @@ private constructor( this.maximumAmount = maximumAmount } + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. @@ -4773,6 +4828,7 @@ private constructor( endDate, externalPriceId, maximumAmount, + metricParameterOverrides, minimumAmount, planPhaseOrder, price, @@ -4794,6 +4850,7 @@ private constructor( endDate() externalPriceId() maximumAmount() + metricParameterOverrides().ifPresent { it.validate() } minimumAmount() planPhaseOrder() price().ifPresent { it.validate() } @@ -4823,12 +4880,126 @@ private constructor( (if (endDate.asKnown().isPresent) 1 else 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + (if (startDate.asKnown().isPresent) 1 else 0) + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New subscription price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -6198,6 +6369,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -6256,6 +6428,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -6279,6 +6454,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -6438,6 +6614,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -6607,6 +6791,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -6680,6 +6874,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -6703,6 +6898,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -7121,6 +7317,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -7217,6 +7434,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -7250,6 +7468,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -7287,6 +7506,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -8284,6 +8504,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -8307,6 +8528,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -8316,7 +8538,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -8339,6 +8561,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -8398,6 +8621,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -8421,6 +8647,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -8580,6 +8807,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -8749,6 +8984,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -8824,6 +9069,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -8848,6 +9094,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -9268,6 +9515,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -9364,6 +9632,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -9397,6 +9666,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -9436,6 +9706,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -10150,6 +10421,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -10173,6 +10445,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -10182,7 +10455,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -10206,6 +10479,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -10266,6 +10540,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -10289,6 +10566,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -10450,6 +10728,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -10619,6 +10905,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -10696,6 +10992,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10723,6 +11020,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -11150,6 +11448,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -11249,6 +11568,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -11282,6 +11602,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -11321,6 +11642,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -11943,6 +12265,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -11966,6 +12289,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -11975,7 +12299,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -11999,6 +12323,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -12059,6 +12384,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -12082,6 +12410,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -12243,6 +12572,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -12412,6 +12749,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -12489,6 +12836,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -12516,6 +12864,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -12943,6 +13292,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -13042,6 +13412,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -13075,6 +13446,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -13114,6 +13486,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -13743,6 +14116,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -13766,6 +14140,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -13775,7 +14150,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -13798,6 +14173,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -13856,6 +14232,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -13879,6 +14258,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -14037,6 +14417,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -14205,6 +14593,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -14278,6 +14676,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -14300,6 +14699,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -14718,6 +15118,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -14814,6 +15235,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -14847,6 +15269,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -14884,6 +15307,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -15353,6 +15777,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -15376,6 +15801,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -15385,7 +15811,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -15408,6 +15834,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -15466,6 +15893,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -15489,6 +15919,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -15648,6 +16079,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -15816,6 +16255,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -15889,6 +16338,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -15911,6 +16361,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -16329,6 +16780,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -16425,6 +16897,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -16458,6 +16931,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -16495,6 +16969,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -17084,6 +17559,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -17107,6 +17583,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -17116,7 +17593,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } @@ -17131,6 +17608,7 @@ private constructor( endDate == other.endDate && externalPriceId == other.externalPriceId && maximumAmount == other.maximumAmount && + metricParameterOverrides == other.metricParameterOverrides && minimumAmount == other.minimumAmount && planPhaseOrder == other.planPhaseOrder && price == other.price && @@ -17146,6 +17624,7 @@ private constructor( endDate, externalPriceId, maximumAmount, + metricParameterOverrides, minimumAmount, planPhaseOrder, price, @@ -17158,7 +17637,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AddPrice{allocationPrice=$allocationPrice, discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, price=$price, priceId=$priceId, startDate=$startDate, additionalProperties=$additionalProperties}" + "AddPrice{allocationPrice=$allocationPrice, discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, maximumAmount=$maximumAmount, metricParameterOverrides=$metricParameterOverrides, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, price=$price, priceId=$priceId, startDate=$startDate, additionalProperties=$additionalProperties}" } /** @@ -18245,6 +18724,7 @@ private constructor( private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, private val maximumAmount: JsonField, + private val metricParameterOverrides: JsonField, private val minimumAmount: JsonField, private val price: JsonField, private val priceId: JsonField, @@ -18271,6 +18751,9 @@ private constructor( @JsonProperty("maximum_amount") @ExcludeMissing maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + metricParameterOverrides: JsonField = JsonMissing.of(), @JsonProperty("minimum_amount") @ExcludeMissing minimumAmount: JsonField = JsonMissing.of(), @@ -18283,6 +18766,7 @@ private constructor( externalPriceId, fixedPriceQuantity, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -18343,6 +18827,16 @@ private constructor( @Deprecated("deprecated") fun maximumAmount(): Optional = maximumAmount.getOptional("maximum_amount") + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metricParameterOverrides(): Optional = + metricParameterOverrides.getOptional("metric_parameter_overrides") + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. @@ -18430,6 +18924,17 @@ private constructor( @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount + /** + * Returns the raw JSON value of [metricParameterOverrides]. + * + * Unlike [metricParameterOverrides], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("metric_parameter_overrides") + @ExcludeMissing + fun _metricParameterOverrides(): JsonField = + metricParameterOverrides + /** * Returns the raw JSON value of [minimumAmount]. * @@ -18489,6 +18994,8 @@ private constructor( private var externalPriceId: JsonField = JsonMissing.of() private var fixedPriceQuantity: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() + private var metricParameterOverrides: JsonField = + JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var price: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() @@ -18502,6 +19009,7 @@ private constructor( externalPriceId = replacePrice.externalPriceId fixedPriceQuantity = replacePrice.fixedPriceQuantity maximumAmount = replacePrice.maximumAmount + metricParameterOverrides = replacePrice.metricParameterOverrides minimumAmount = replacePrice.minimumAmount price = replacePrice.price priceId = replacePrice.priceId @@ -18654,6 +19162,32 @@ private constructor( this.maximumAmount = maximumAmount } + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + fun metricParameterOverrides(metricParameterOverrides: MetricParameterOverrides?) = + metricParameterOverrides(JsonField.ofNullable(metricParameterOverrides)) + + /** + * Alias for calling [Builder.metricParameterOverrides] with + * `metricParameterOverrides.orElse(null)`. + */ + fun metricParameterOverrides( + metricParameterOverrides: Optional + ) = metricParameterOverrides(metricParameterOverrides.getOrNull()) + + /** + * Sets [Builder.metricParameterOverrides] to an arbitrary JSON value. + * + * You should usually call [Builder.metricParameterOverrides] with a well-typed + * [MetricParameterOverrides] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun metricParameterOverrides( + metricParameterOverrides: JsonField + ) = apply { this.metricParameterOverrides = metricParameterOverrides } + /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. @@ -18908,6 +19442,7 @@ private constructor( externalPriceId, fixedPriceQuantity, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -18928,6 +19463,7 @@ private constructor( externalPriceId() fixedPriceQuantity() maximumAmount() + metricParameterOverrides().ifPresent { it.validate() } minimumAmount() price().ifPresent { it.validate() } priceId() @@ -18956,10 +19492,124 @@ private constructor( (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + + (metricParameterOverrides.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + (price.asKnown().getOrNull()?.validity() ?: 0) + (if (priceId.asKnown().isPresent) 1 else 0) + /** + * Override values for parameterized billable metric variables. Keys are parameter names, + * values are the override values. + */ + class MetricParameterOverrides + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [MetricParameterOverrides]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MetricParameterOverrides]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metricParameterOverrides: MetricParameterOverrides) = apply { + additionalProperties = + metricParameterOverrides.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) + } + + /** + * Returns an immutable instance of [MetricParameterOverrides]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MetricParameterOverrides = + MetricParameterOverrides(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): MetricParameterOverrides = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OrbInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MetricParameterOverrides && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MetricParameterOverrides{additionalProperties=$additionalProperties}" + } + /** New subscription price request body params. */ @JsonDeserialize(using = Price.Deserializer::class) @JsonSerialize(using = Price.Serializer::class) @@ -20329,6 +20979,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -20387,6 +21038,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -20410,6 +21064,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -20569,6 +21224,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -20738,6 +21401,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -20811,6 +21484,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -20834,6 +21508,7 @@ private constructor( fixedPriceQuantity = bulkWithFilters.fixedPriceQuantity invoiceGroupingKey = bulkWithFilters.invoiceGroupingKey invoicingCycleConfiguration = bulkWithFilters.invoicingCycleConfiguration + licenseTypeId = bulkWithFilters.licenseTypeId metadata = bulkWithFilters.metadata referenceId = bulkWithFilters.referenceId additionalProperties = bulkWithFilters.additionalProperties.toMutableMap() @@ -21252,6 +21927,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -21348,6 +22044,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -21381,6 +22078,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -21418,6 +22116,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -22415,6 +23114,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -22438,6 +23138,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -22447,7 +23148,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "BulkWithFilters{bulkWithFiltersConfig=$bulkWithFiltersConfig, cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class TieredWithProration @@ -22470,6 +23171,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -22529,6 +23231,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -22552,6 +23257,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -22711,6 +23417,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -22880,6 +23594,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -22955,6 +23679,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -22979,6 +23704,7 @@ private constructor( invoiceGroupingKey = tieredWithProration.invoiceGroupingKey invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + licenseTypeId = tieredWithProration.licenseTypeId metadata = tieredWithProration.metadata referenceId = tieredWithProration.referenceId additionalProperties = @@ -23399,6 +24125,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -23495,6 +24242,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -23528,6 +24276,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -23567,6 +24316,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -24281,6 +25031,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -24304,6 +25055,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -24313,7 +25065,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "TieredWithProration{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class GroupedWithMinMaxThresholds @@ -24337,6 +25089,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -24397,6 +25150,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -24420,6 +25176,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -24581,6 +25338,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -24750,6 +25515,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -24827,6 +25602,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -24854,6 +25630,7 @@ private constructor( invoiceGroupingKey = groupedWithMinMaxThresholds.invoiceGroupingKey invoicingCycleConfiguration = groupedWithMinMaxThresholds.invoicingCycleConfiguration + licenseTypeId = groupedWithMinMaxThresholds.licenseTypeId metadata = groupedWithMinMaxThresholds.metadata referenceId = groupedWithMinMaxThresholds.referenceId additionalProperties = @@ -25281,6 +26058,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -25380,6 +26178,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -25413,6 +26212,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -25452,6 +26252,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -26074,6 +26875,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -26097,6 +26899,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -26106,7 +26909,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholds{cadence=$cadence, groupedWithMinMaxThresholdsConfig=$groupedWithMinMaxThresholdsConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class CumulativeGroupedAllocation @@ -26130,6 +26933,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -26190,6 +26994,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -26213,6 +27020,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -26374,6 +27182,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -26543,6 +27359,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -26620,6 +27446,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -26647,6 +27474,7 @@ private constructor( invoiceGroupingKey = cumulativeGroupedAllocation.invoiceGroupingKey invoicingCycleConfiguration = cumulativeGroupedAllocation.invoicingCycleConfiguration + licenseTypeId = cumulativeGroupedAllocation.licenseTypeId metadata = cumulativeGroupedAllocation.metadata referenceId = cumulativeGroupedAllocation.referenceId additionalProperties = @@ -27074,6 +27902,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -27173,6 +28022,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -27206,6 +28056,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -27245,6 +28096,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -27874,6 +28726,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -27897,6 +28750,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -27906,7 +28760,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "CumulativeGroupedAllocation{cadence=$cadence, cumulativeGroupedAllocationConfig=$cumulativeGroupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class Percent @@ -27929,6 +28783,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -27987,6 +28842,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -28010,6 +28868,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -28168,6 +29027,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -28336,6 +29203,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -28409,6 +29286,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -28431,6 +29309,7 @@ private constructor( fixedPriceQuantity = percent.fixedPriceQuantity invoiceGroupingKey = percent.invoiceGroupingKey invoicingCycleConfiguration = percent.invoicingCycleConfiguration + licenseTypeId = percent.licenseTypeId metadata = percent.metadata referenceId = percent.referenceId additionalProperties = percent.additionalProperties.toMutableMap() @@ -28849,6 +29728,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -28945,6 +29845,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -28978,6 +29879,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -29015,6 +29917,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -29484,6 +30387,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -29507,6 +30411,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -29516,7 +30421,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "Percent{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, percentConfig=$percentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } class EventOutput @@ -29539,6 +30444,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoiceGroupingKey: JsonField, private val invoicingCycleConfiguration: JsonField, + private val licenseTypeId: JsonField, private val metadata: JsonField, private val referenceId: JsonField, private val additionalProperties: MutableMap, @@ -29597,6 +30503,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("license_type_id") + @ExcludeMissing + licenseTypeId: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -29620,6 +30529,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, mutableMapOf(), @@ -29779,6 +30689,14 @@ private constructor( fun invoicingCycleConfiguration(): Optional = invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + /** + * The ID of the license type to associate with this price. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id") + /** * 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 @@ -29947,6 +30865,16 @@ private constructor( fun _invoicingCycleConfiguration(): JsonField = invoicingCycleConfiguration + /** + * Returns the raw JSON value of [licenseTypeId]. + * + * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("license_type_id") + @ExcludeMissing + fun _licenseTypeId(): JsonField = licenseTypeId + /** * Returns the raw JSON value of [metadata]. * @@ -30020,6 +30948,7 @@ private constructor( private var invoicingCycleConfiguration: JsonField = JsonMissing.of() + private var licenseTypeId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var referenceId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -30042,6 +30971,7 @@ private constructor( fixedPriceQuantity = eventOutput.fixedPriceQuantity invoiceGroupingKey = eventOutput.invoiceGroupingKey invoicingCycleConfiguration = eventOutput.invoicingCycleConfiguration + licenseTypeId = eventOutput.licenseTypeId metadata = eventOutput.metadata referenceId = eventOutput.referenceId additionalProperties = eventOutput.additionalProperties.toMutableMap() @@ -30460,6 +31390,27 @@ private constructor( invoicingCycleConfiguration: JsonField ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + /** The ID of the license type to associate with this price. */ + fun licenseTypeId(licenseTypeId: String?) = + licenseTypeId(JsonField.ofNullable(licenseTypeId)) + + /** + * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. + */ + fun licenseTypeId(licenseTypeId: Optional) = + licenseTypeId(licenseTypeId.getOrNull()) + + /** + * Sets [Builder.licenseTypeId] to an arbitrary JSON value. + * + * You should usually call [Builder.licenseTypeId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun licenseTypeId(licenseTypeId: JsonField) = apply { + this.licenseTypeId = licenseTypeId + } + /** * 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 @@ -30556,6 +31507,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties.toMutableMap(), @@ -30589,6 +31541,7 @@ private constructor( fixedPriceQuantity() invoiceGroupingKey() invoicingCycleConfiguration().ifPresent { it.validate() } + licenseTypeId() metadata().ifPresent { it.validate() } referenceId() validated = true @@ -30626,6 +31579,7 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (if (invoiceGroupingKey.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (if (licenseTypeId.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (referenceId.asKnown().isPresent) 1 else 0) @@ -31215,6 +32169,7 @@ private constructor( fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && + licenseTypeId == other.licenseTypeId && metadata == other.metadata && referenceId == other.referenceId && additionalProperties == other.additionalProperties @@ -31238,6 +32193,7 @@ private constructor( fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, + licenseTypeId, metadata, referenceId, additionalProperties, @@ -31247,7 +32203,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" + "EventOutput{cadence=$cadence, eventOutputConfig=$eventOutputConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, currency=$currency, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, licenseTypeId=$licenseTypeId, metadata=$metadata, referenceId=$referenceId, additionalProperties=$additionalProperties}" } } @@ -31263,6 +32219,7 @@ private constructor( externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && maximumAmount == other.maximumAmount && + metricParameterOverrides == other.metricParameterOverrides && minimumAmount == other.minimumAmount && price == other.price && priceId == other.priceId && @@ -31277,6 +32234,7 @@ private constructor( externalPriceId, fixedPriceQuantity, maximumAmount, + metricParameterOverrides, minimumAmount, price, priceId, @@ -31287,7 +32245,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ReplacePrice{replacesPriceId=$replacesPriceId, allocationPrice=$allocationPrice, discounts=$discounts, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" + "ReplacePrice{replacesPriceId=$replacesPriceId, allocationPrice=$allocationPrice, discounts=$discounts, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, maximumAmount=$maximumAmount, metricParameterOverrides=$metricParameterOverrides, minimumAmount=$minimumAmount, price=$price, priceId=$priceId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsync.kt index 05a0b24e9..085fdf56b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsync.kt @@ -7,6 +7,8 @@ import com.withorb.api.core.RequestOptions import com.withorb.api.core.http.HttpResponse import com.withorb.api.core.http.HttpResponseFor import com.withorb.api.models.CreditBlockDeleteParams +import com.withorb.api.models.CreditBlockListInvoicesParams +import com.withorb.api.models.CreditBlockListInvoicesResponse import com.withorb.api.models.CreditBlockRetrieveParams import com.withorb.api.models.CreditBlockRetrieveResponse import java.util.concurrent.CompletableFuture @@ -108,6 +110,58 @@ interface CreditBlockServiceAsync { fun delete(blockId: String, requestOptions: RequestOptions): CompletableFuture = delete(blockId, CreditBlockDeleteParams.none(), requestOptions) + /** + * This endpoint returns the credit block and its associated purchasing invoices. + * + * If a credit block was purchased (as opposed to being manually added or allocated from a + * subscription), this endpoint returns the invoices that were created to charge the customer + * for the credit block. For credit blocks with payment schedules spanning multiple periods + * (e.g., monthly payments over 12 months), multiple invoices will be returned. + * + * If the credit block was not purchased (e.g., manual increment, allocation), an empty invoices + * list is returned. + * + * **Note: This endpoint is currently experimental and its interface may change in future + * releases. Please contact support before building production integrations against this + * endpoint.** + */ + fun listInvoices(blockId: String): CompletableFuture = + listInvoices(blockId, CreditBlockListInvoicesParams.none()) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + listInvoices(params.toBuilder().blockId(blockId).build(), requestOptions) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + ): CompletableFuture = + listInvoices(blockId, params, RequestOptions.none()) + + /** @see listInvoices */ + fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see listInvoices */ + fun listInvoices( + params: CreditBlockListInvoicesParams + ): CompletableFuture = + listInvoices(params, RequestOptions.none()) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + listInvoices(blockId, CreditBlockListInvoicesParams.none(), requestOptions) + /** * A view of [CreditBlockServiceAsync] that provides access to raw HTTP responses for each * method. @@ -203,5 +257,48 @@ interface CreditBlockServiceAsync { requestOptions: RequestOptions, ): CompletableFuture = delete(blockId, CreditBlockDeleteParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /credit_blocks/{block_id}/invoices`, but is + * otherwise the same as [CreditBlockServiceAsync.listInvoices]. + */ + fun listInvoices( + blockId: String + ): CompletableFuture> = + listInvoices(blockId, CreditBlockListInvoicesParams.none()) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + listInvoices(params.toBuilder().blockId(blockId).build(), requestOptions) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + ): CompletableFuture> = + listInvoices(blockId, params, RequestOptions.none()) + + /** @see listInvoices */ + fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see listInvoices */ + fun listInvoices( + params: CreditBlockListInvoicesParams + ): CompletableFuture> = + listInvoices(params, RequestOptions.none()) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + listInvoices(blockId, CreditBlockListInvoicesParams.none(), requestOptions) } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncImpl.kt index 55b2ff1c8..825cf6b72 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncImpl.kt @@ -18,6 +18,8 @@ import com.withorb.api.core.http.json import com.withorb.api.core.http.parseable import com.withorb.api.core.prepareAsync import com.withorb.api.models.CreditBlockDeleteParams +import com.withorb.api.models.CreditBlockListInvoicesParams +import com.withorb.api.models.CreditBlockListInvoicesResponse import com.withorb.api.models.CreditBlockRetrieveParams import com.withorb.api.models.CreditBlockRetrieveResponse import java.util.concurrent.CompletableFuture @@ -50,6 +52,13 @@ class CreditBlockServiceAsyncImpl internal constructor(private val clientOptions // delete /credit_blocks/{block_id} withRawResponse().delete(params, requestOptions).thenAccept {} + override fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /credit_blocks/{block_id}/invoices + withRawResponse().listInvoices(params, requestOptions).thenApply { it.parse() } + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : CreditBlockServiceAsync.WithRawResponse { @@ -122,5 +131,38 @@ class CreditBlockServiceAsyncImpl internal constructor(private val clientOptions } } } + + private val listInvoicesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("blockId", params.blockId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("credit_blocks", params._pathParam(0), "invoices") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listInvoicesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt index 6cacdd7e3..d1480bd57 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt @@ -13,6 +13,8 @@ import com.withorb.api.models.InvoiceFetchParams import com.withorb.api.models.InvoiceFetchUpcomingParams import com.withorb.api.models.InvoiceFetchUpcomingResponse import com.withorb.api.models.InvoiceIssueParams +import com.withorb.api.models.InvoiceIssueSummaryParams +import com.withorb.api.models.InvoiceIssueSummaryResponse import com.withorb.api.models.InvoiceListPageAsync import com.withorb.api.models.InvoiceListParams import com.withorb.api.models.InvoiceListSummaryPageAsync @@ -235,6 +237,52 @@ interface InvoiceServiceAsync { fun issue(invoiceId: String, requestOptions: RequestOptions): CompletableFuture = issue(invoiceId, InvoiceIssueParams.none(), requestOptions) + /** + * This endpoint allows an eligible invoice to be issued manually. This is only possible with + * invoices where status is `draft`, `will_auto_issue` is false, and an `eligible_to_issue_at` + * is a time in the past. Issuing an invoice could possibly trigger side effects, some of which + * could be customer-visible (e.g. sending emails, auto-collecting payment, syncing the invoice + * to external providers, etc). + * + * This is a lighter-weight alternative to the issue invoice endpoint, returning an invoice + * summary without any line item details. + */ + fun issueSummary(invoiceId: String): CompletableFuture = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none()) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + issueSummary(params.toBuilder().invoiceId(invoiceId).build(), requestOptions) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + ): CompletableFuture = + issueSummary(invoiceId, params, RequestOptions.none()) + + /** @see issueSummary */ + fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see issueSummary */ + fun issueSummary( + params: InvoiceIssueSummaryParams + ): CompletableFuture = issueSummary(params, RequestOptions.none()) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none(), requestOptions) + /** * This is a lighter-weight endpoint that returns a list of all * [`Invoice`](/core-concepts#invoice) summaries for an account in a list format. @@ -587,6 +635,49 @@ interface InvoiceServiceAsync { ): CompletableFuture> = issue(invoiceId, InvoiceIssueParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `post /invoices/summary/{invoice_id}/issue`, but is + * otherwise the same as [InvoiceServiceAsync.issueSummary]. + */ + fun issueSummary( + invoiceId: String + ): CompletableFuture> = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none()) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + issueSummary(params.toBuilder().invoiceId(invoiceId).build(), requestOptions) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + ): CompletableFuture> = + issueSummary(invoiceId, params, RequestOptions.none()) + + /** @see issueSummary */ + fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see issueSummary */ + fun issueSummary( + params: InvoiceIssueSummaryParams + ): CompletableFuture> = + issueSummary(params, RequestOptions.none()) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /invoices/summary`, but is otherwise the same as * [InvoiceServiceAsync.listSummary]. 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 7ccb58e57..3476c0533 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 @@ -24,6 +24,8 @@ import com.withorb.api.models.InvoiceFetchParams import com.withorb.api.models.InvoiceFetchUpcomingParams import com.withorb.api.models.InvoiceFetchUpcomingResponse import com.withorb.api.models.InvoiceIssueParams +import com.withorb.api.models.InvoiceIssueSummaryParams +import com.withorb.api.models.InvoiceIssueSummaryResponse import com.withorb.api.models.InvoiceListPageAsync import com.withorb.api.models.InvoiceListPageResponse import com.withorb.api.models.InvoiceListParams @@ -99,6 +101,13 @@ class InvoiceServiceAsyncImpl internal constructor(private val clientOptions: Cl // post /invoices/{invoice_id}/issue withRawResponse().issue(params, requestOptions).thenApply { it.parse() } + override fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /invoices/summary/{invoice_id}/issue + withRawResponse().issueSummary(params, requestOptions).thenApply { it.parse() } + override fun listSummary( params: InvoiceListSummaryParams, requestOptions: RequestOptions, @@ -368,6 +377,40 @@ class InvoiceServiceAsyncImpl internal constructor(private val clientOptions: Cl } } + private val issueSummaryHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("invoiceId", params.invoiceId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("invoices", "summary", params._pathParam(0), "issue") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { issueSummaryHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val listSummaryHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseServiceAsync.kt new file mode 100644 index 000000000..57f0bf588 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseServiceAsync.kt @@ -0,0 +1,343 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseCreateParams +import com.withorb.api.models.LicenseCreateResponse +import com.withorb.api.models.LicenseDeactivateParams +import com.withorb.api.models.LicenseDeactivateResponse +import com.withorb.api.models.LicenseListPageAsync +import com.withorb.api.models.LicenseListParams +import com.withorb.api.models.LicenseRetrieveByExternalIdParams +import com.withorb.api.models.LicenseRetrieveByExternalIdResponse +import com.withorb.api.models.LicenseRetrieveParams +import com.withorb.api.models.LicenseRetrieveResponse +import com.withorb.api.services.async.licenses.ExternalLicenseServiceAsync +import com.withorb.api.services.async.licenses.UsageServiceAsync +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface LicenseServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): LicenseServiceAsync + + fun externalLicenses(): ExternalLicenseServiceAsync + + fun usage(): UsageServiceAsync + + /** + * This endpoint is used to create a new license for a user. + * + * If a start date is provided, the license will be activated at the **start** of the specified + * date in the customer's timezone. Otherwise, the activation time will default to the **start** + * of the current day in the customer's timezone. + */ + fun create(params: LicenseCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** This endpoint is used to fetch a license given an identifier. */ + fun retrieve(licenseId: String): CompletableFuture = + retrieve(licenseId, LicenseRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + ): CompletableFuture = + retrieve(licenseId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve(params: LicenseRetrieveParams): CompletableFuture = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(licenseId, LicenseRetrieveParams.none(), requestOptions) + + /** This endpoint returns a list of all licenses for a subscription. */ + fun list(params: LicenseListParams): CompletableFuture = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + params: LicenseListParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * This endpoint is used to deactivate an existing license. + * + * If an end date is provided, the license will be deactivated at the **start** of the specified + * date in the customer's timezone. Otherwise, the deactivation time will default to the **end** + * of the current day in the customer's timezone. + */ + fun deactivate(licenseId: String): CompletableFuture = + deactivate(licenseId, LicenseDeactivateParams.none()) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + deactivate(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + ): CompletableFuture = + deactivate(licenseId, params, RequestOptions.none()) + + /** @see deactivate */ + fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see deactivate */ + fun deactivate(params: LicenseDeactivateParams): CompletableFuture = + deactivate(params, RequestOptions.none()) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + deactivate(licenseId, LicenseDeactivateParams.none(), requestOptions) + + /** This endpoint is used to fetch a license given an external license identifier. */ + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + ): CompletableFuture = + retrieveByExternalId(externalLicenseId, params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieveByExternalId( + params.toBuilder().externalLicenseId(externalLicenseId).build(), + requestOptions, + ) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams + ): CompletableFuture = + retrieveByExternalId(params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * A view of [LicenseServiceAsync] that provides access to raw HTTP responses for each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): LicenseServiceAsync.WithRawResponse + + fun externalLicenses(): ExternalLicenseServiceAsync.WithRawResponse + + fun usage(): UsageServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /licenses`, but is otherwise the same as + * [LicenseServiceAsync.create]. + */ + fun create( + params: LicenseCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /licenses/{license_id}`, but is otherwise the same + * as [LicenseServiceAsync.retrieve]. + */ + fun retrieve( + licenseId: String + ): CompletableFuture> = + retrieve(licenseId, LicenseRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + ): CompletableFuture> = + retrieve(licenseId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: LicenseRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve(licenseId, LicenseRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /licenses`, but is otherwise the same as + * [LicenseServiceAsync.list]. + */ + fun list( + params: LicenseListParams + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + params: LicenseListParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `post /licenses/{license_id}/deactivate`, but is + * otherwise the same as [LicenseServiceAsync.deactivate]. + */ + fun deactivate( + licenseId: String + ): CompletableFuture> = + deactivate(licenseId, LicenseDeactivateParams.none()) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + deactivate(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + ): CompletableFuture> = + deactivate(licenseId, params, RequestOptions.none()) + + /** @see deactivate */ + fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see deactivate */ + fun deactivate( + params: LicenseDeactivateParams + ): CompletableFuture> = + deactivate(params, RequestOptions.none()) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + deactivate(licenseId, LicenseDeactivateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get + * /licenses/external_license_id/{external_license_id}`, but is otherwise the same as + * [LicenseServiceAsync.retrieveByExternalId]. + */ + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + ): CompletableFuture> = + retrieveByExternalId(externalLicenseId, params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieveByExternalId( + params.toBuilder().externalLicenseId(externalLicenseId).build(), + requestOptions, + ) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams + ): CompletableFuture> = + retrieveByExternalId(params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseServiceAsyncImpl.kt new file mode 100644 index 000000000..50d467a57 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseServiceAsyncImpl.kt @@ -0,0 +1,290 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.json +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepareAsync +import com.withorb.api.models.LicenseCreateParams +import com.withorb.api.models.LicenseCreateResponse +import com.withorb.api.models.LicenseDeactivateParams +import com.withorb.api.models.LicenseDeactivateResponse +import com.withorb.api.models.LicenseListPageAsync +import com.withorb.api.models.LicenseListPageResponse +import com.withorb.api.models.LicenseListParams +import com.withorb.api.models.LicenseRetrieveByExternalIdParams +import com.withorb.api.models.LicenseRetrieveByExternalIdResponse +import com.withorb.api.models.LicenseRetrieveParams +import com.withorb.api.models.LicenseRetrieveResponse +import com.withorb.api.services.async.licenses.ExternalLicenseServiceAsync +import com.withorb.api.services.async.licenses.ExternalLicenseServiceAsyncImpl +import com.withorb.api.services.async.licenses.UsageServiceAsync +import com.withorb.api.services.async.licenses.UsageServiceAsyncImpl +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class LicenseServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseServiceAsync { + + private val withRawResponse: LicenseServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + private val externalLicenses: ExternalLicenseServiceAsync by lazy { + ExternalLicenseServiceAsyncImpl(clientOptions) + } + + private val usage: UsageServiceAsync by lazy { UsageServiceAsyncImpl(clientOptions) } + + override fun withRawResponse(): LicenseServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): LicenseServiceAsync = + LicenseServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun externalLicenses(): ExternalLicenseServiceAsync = externalLicenses + + override fun usage(): UsageServiceAsync = usage + + override fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /licenses + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + override fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /licenses/{license_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: LicenseListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /licenses + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + override fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /licenses/{license_id}/deactivate + withRawResponse().deactivate(params, requestOptions).thenApply { it.parse() } + + override fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /licenses/external_license_id/{external_license_id} + withRawResponse().retrieveByExternalId(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + private val externalLicenses: ExternalLicenseServiceAsync.WithRawResponse by lazy { + ExternalLicenseServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val usage: UsageServiceAsync.WithRawResponse by lazy { + UsageServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + override fun withOptions( + modifier: Consumer + ): LicenseServiceAsync.WithRawResponse = + LicenseServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun externalLicenses(): ExternalLicenseServiceAsync.WithRawResponse = + externalLicenses + + override fun usage(): UsageServiceAsync.WithRawResponse = usage + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseId", params.licenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: LicenseListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + LicenseListPageAsync.builder() + .service(LicenseServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + + private val deactivateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseId", params.licenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", params._pathParam(0), "deactivate") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { deactivateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val retrieveByExternalIdHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("externalLicenseId", params.externalLicenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", "external_license_id", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveByExternalIdHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsync.kt new file mode 100644 index 000000000..f6d950cf6 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsync.kt @@ -0,0 +1,210 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseTypeCreateParams +import com.withorb.api.models.LicenseTypeCreateResponse +import com.withorb.api.models.LicenseTypeListPageAsync +import com.withorb.api.models.LicenseTypeListParams +import com.withorb.api.models.LicenseTypeRetrieveParams +import com.withorb.api.models.LicenseTypeRetrieveResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface LicenseTypeServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): LicenseTypeServiceAsync + + /** + * This endpoint is used to create a new license type. + * + * License types are used to group licenses and define billing behavior. Each license type has a + * name and a grouping key that determines how metrics are aggregated for billing purposes. + */ + fun create(params: LicenseTypeCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * This endpoint returns a license type identified by its license_type_id. + * + * Use this endpoint to retrieve details about a specific license type, including its name and + * grouping key. + */ + fun retrieve(licenseTypeId: String): CompletableFuture = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().licenseTypeId(licenseTypeId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + ): CompletableFuture = + retrieve(licenseTypeId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve( + params: LicenseTypeRetrieveParams + ): CompletableFuture = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none(), requestOptions) + + /** + * This endpoint returns a list of all license types configured for the account, ordered in + * ascending order by creation time. + * + * License types are used to group licenses and define billing behavior. Each license type has a + * name and a grouping key that determines how metrics are aggregated for billing purposes. + */ + fun list(): CompletableFuture = list(LicenseTypeListParams.none()) + + /** @see list */ + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(LicenseTypeListParams.none(), requestOptions) + + /** + * A view of [LicenseTypeServiceAsync] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): LicenseTypeServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /license_types`, but is otherwise the same as + * [LicenseTypeServiceAsync.create]. + */ + fun create( + params: LicenseTypeCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /license_types/{license_type_id}`, but is otherwise + * the same as [LicenseTypeServiceAsync.retrieve]. + */ + fun retrieve( + licenseTypeId: String + ): CompletableFuture> = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve(params.toBuilder().licenseTypeId(licenseTypeId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + ): CompletableFuture> = + retrieve(licenseTypeId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: LicenseTypeRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /license_types`, but is otherwise the same as + * [LicenseTypeServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(LicenseTypeListParams.none()) + + /** @see list */ + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(LicenseTypeListParams.none(), requestOptions) + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsyncImpl.kt new file mode 100644 index 000000000..17943a906 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsyncImpl.kt @@ -0,0 +1,178 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.json +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepareAsync +import com.withorb.api.models.LicenseTypeCreateParams +import com.withorb.api.models.LicenseTypeCreateResponse +import com.withorb.api.models.LicenseTypeListPageAsync +import com.withorb.api.models.LicenseTypeListPageResponse +import com.withorb.api.models.LicenseTypeListParams +import com.withorb.api.models.LicenseTypeRetrieveParams +import com.withorb.api.models.LicenseTypeRetrieveResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class LicenseTypeServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseTypeServiceAsync { + + private val withRawResponse: LicenseTypeServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): LicenseTypeServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): LicenseTypeServiceAsync = + LicenseTypeServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /license_types + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + override fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /license_types/{license_type_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: LicenseTypeListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /license_types + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseTypeServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): LicenseTypeServiceAsync.WithRawResponse = + LicenseTypeServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("license_types") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseTypeId", params.licenseTypeId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("license_types", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: LicenseTypeListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("license_types") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + LicenseTypeListPageAsync.builder() + .service(LicenseTypeServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsync.kt index 59bc036ab..ee9c9caea 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsync.kt @@ -40,6 +40,11 @@ interface CreditServiceAsync { * * Note that `currency` defaults to credits if not specified. To use a real world currency, set * `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the `effective_date[gte]`, + * `effective_date[gt]`, `effective_date[lt]`, and `effective_date[lte]` query parameters. This + * filters on when the credit block becomes effective, which may differ from creation time for + * backdated credits. */ fun list(customerId: String): CompletableFuture = list(customerId, CustomerCreditListParams.none()) @@ -84,6 +89,11 @@ interface CreditServiceAsync { * * Note that `currency` defaults to credits if not specified. To use a real world currency, set * `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the `effective_date[gte]`, + * `effective_date[gt]`, `effective_date[lt]`, and `effective_date[lte]` query parameters. This + * filters on when the credit block becomes effective, which may differ from creation time for + * backdated credits. */ fun listByExternalId( externalCustomerId: String diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt index bee830085..1f862acd3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt @@ -54,10 +54,8 @@ interface LedgerServiceAsync { * * As usage for a customer is reported into Orb, credits may be deducted according to the * customer's plan configuration. An automated deduction of this type will result in a ledger - * entry, also with a starting and ending balance. In order to provide better tracing - * capabilities for automatic deductions, Orb always associates each automatic deduction with - * the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place - * and to ensure that credits are never deducted without an associated usage event. + * entry, also with a starting and ending balance. Each day's usage for a particular price, + * invoice, and block will be grouped into a single entry. * * By default, Orb uses an algorithm that automatically deducts from the *soonest expiring * credit block* first in order to ensure that all credits are utilized appropriately. As an @@ -181,7 +179,8 @@ interface LedgerServiceAsync { * you pass `invoice_settings` in the body of this request, Orb will also generate a one-off * invoice for the customer for the credits pre-purchase. Note that you _must_ provide the * `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying - * the cost basis with the number of credit units added. + * the cost basis with the number of credit units added. Additionally, Orb also enforces invoice + * generation when a non-zero `per_unit_cost_basis` value is provided. * * ## Deducting Credits * Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. @@ -306,7 +305,8 @@ interface LedgerServiceAsync { * you pass `invoice_settings` in the body of this request, Orb will also generate a one-off * invoice for the customer for the credits pre-purchase. Note that you _must_ provide the * `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying - * the cost basis with the number of credit units added. + * the cost basis with the number of credit units added. Additionally, Orb also enforces invoice + * generation when a non-zero `per_unit_cost_basis` value is provided. * * ## Deducting Credits * Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. @@ -415,10 +415,8 @@ interface LedgerServiceAsync { * * As usage for a customer is reported into Orb, credits may be deducted according to the * customer's plan configuration. An automated deduction of this type will result in a ledger - * entry, also with a starting and ending balance. In order to provide better tracing - * capabilities for automatic deductions, Orb always associates each automatic deduction with - * the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place - * and to ensure that credits are never deducted without an associated usage event. + * entry, also with a starting and ending balance. Each day's usage for a particular price, + * invoice, and block will be grouped into a single entry. * * By default, Orb uses an algorithm that automatically deducts from the *soonest expiring * credit block* first in order to ensure that all credits are utilized appropriately. As an diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsync.kt new file mode 100644 index 000000000..289c08001 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsync.kt @@ -0,0 +1,107 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async.licenses + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseExternalLicenseGetUsageParams +import com.withorb.api.models.LicenseExternalLicenseGetUsageResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface ExternalLicenseServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): ExternalLicenseServiceAsync + + /** + * Returns usage and remaining credits for a license identified by its external license ID. + * + * Date range defaults to the current billing period if not specified. + */ + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + ): CompletableFuture = + getUsage(externalLicenseId, params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getUsage(params.toBuilder().externalLicenseId(externalLicenseId).build(), requestOptions) + + /** @see getUsage */ + fun getUsage( + params: LicenseExternalLicenseGetUsageParams + ): CompletableFuture = + getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * A view of [ExternalLicenseServiceAsync] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): ExternalLicenseServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get + * /licenses/external_licenses/{external_license_id}/usage`, but is otherwise the same as + * [ExternalLicenseServiceAsync.getUsage]. + */ + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + ): CompletableFuture> = + getUsage(externalLicenseId, params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getUsage( + params.toBuilder().externalLicenseId(externalLicenseId).build(), + requestOptions, + ) + + /** @see getUsage */ + fun getUsage( + params: LicenseExternalLicenseGetUsageParams + ): CompletableFuture> = + getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsyncImpl.kt new file mode 100644 index 000000000..e90011845 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsyncImpl.kt @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async.licenses + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepareAsync +import com.withorb.api.models.LicenseExternalLicenseGetUsageParams +import com.withorb.api.models.LicenseExternalLicenseGetUsageResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class ExternalLicenseServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : ExternalLicenseServiceAsync { + + private val withRawResponse: ExternalLicenseServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ExternalLicenseServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): ExternalLicenseServiceAsync = + ExternalLicenseServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /licenses/external_licenses/{external_license_id}/usage + withRawResponse().getUsage(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ExternalLicenseServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): ExternalLicenseServiceAsync.WithRawResponse = + ExternalLicenseServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val getUsageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("externalLicenseId", params.externalLicenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", "external_licenses", params._pathParam(0), "usage") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { getUsageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsync.kt new file mode 100644 index 000000000..d846cfdd6 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsync.kt @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async.licenses + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseUsageGetAllUsageParams +import com.withorb.api.models.LicenseUsageGetAllUsageResponse +import com.withorb.api.models.LicenseUsageGetUsageParams +import com.withorb.api.models.LicenseUsageGetUsageResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface UsageServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): UsageServiceAsync + + /** + * Returns usage and remaining credits for all licenses of a given type on a subscription. + * + * Date range defaults to the current billing period if not specified. + */ + fun getAllUsage( + params: LicenseUsageGetAllUsageParams + ): CompletableFuture = + getAllUsage(params, RequestOptions.none()) + + /** @see getAllUsage */ + fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * Returns usage and remaining credits for a specific license over a date range. + * + * Date range defaults to the current billing period if not specified. + */ + fun getUsage(licenseId: String): CompletableFuture = + getUsage(licenseId, LicenseUsageGetUsageParams.none()) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getUsage(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + ): CompletableFuture = + getUsage(licenseId, params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getUsage */ + fun getUsage( + params: LicenseUsageGetUsageParams + ): CompletableFuture = getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getUsage(licenseId, LicenseUsageGetUsageParams.none(), requestOptions) + + /** A view of [UsageServiceAsync] that provides access to raw HTTP responses for each method. */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): UsageServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get /licenses/usage`, but is otherwise the same as + * [UsageServiceAsync.getAllUsage]. + */ + fun getAllUsage( + params: LicenseUsageGetAllUsageParams + ): CompletableFuture> = + getAllUsage(params, RequestOptions.none()) + + /** @see getAllUsage */ + fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /licenses/{license_id}/usage`, but is otherwise the + * same as [UsageServiceAsync.getUsage]. + */ + fun getUsage( + licenseId: String + ): CompletableFuture> = + getUsage(licenseId, LicenseUsageGetUsageParams.none()) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getUsage(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + ): CompletableFuture> = + getUsage(licenseId, params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getUsage */ + fun getUsage( + params: LicenseUsageGetUsageParams + ): CompletableFuture> = + getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + getUsage(licenseId, LicenseUsageGetUsageParams.none(), requestOptions) + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsyncImpl.kt new file mode 100644 index 000000000..8da2e6b38 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsyncImpl.kt @@ -0,0 +1,128 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async.licenses + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepareAsync +import com.withorb.api.models.LicenseUsageGetAllUsageParams +import com.withorb.api.models.LicenseUsageGetAllUsageResponse +import com.withorb.api.models.LicenseUsageGetUsageParams +import com.withorb.api.models.LicenseUsageGetUsageResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class UsageServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + UsageServiceAsync { + + private val withRawResponse: UsageServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): UsageServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): UsageServiceAsync = + UsageServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /licenses/usage + withRawResponse().getAllUsage(params, requestOptions).thenApply { it.parse() } + + override fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /licenses/{license_id}/usage + withRawResponse().getUsage(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + UsageServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): UsageServiceAsync.WithRawResponse = + UsageServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val getAllUsageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", "usage") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { getAllUsageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getUsageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseId", params.licenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", params._pathParam(0), "usage") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { getUsageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockService.kt index 2200263f2..6cbef498c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockService.kt @@ -8,6 +8,8 @@ import com.withorb.api.core.RequestOptions import com.withorb.api.core.http.HttpResponse import com.withorb.api.core.http.HttpResponseFor import com.withorb.api.models.CreditBlockDeleteParams +import com.withorb.api.models.CreditBlockListInvoicesParams +import com.withorb.api.models.CreditBlockListInvoicesResponse import com.withorb.api.models.CreditBlockRetrieveParams import com.withorb.api.models.CreditBlockRetrieveResponse import java.util.function.Consumer @@ -98,6 +100,55 @@ interface CreditBlockService { fun delete(blockId: String, requestOptions: RequestOptions) = delete(blockId, CreditBlockDeleteParams.none(), requestOptions) + /** + * This endpoint returns the credit block and its associated purchasing invoices. + * + * If a credit block was purchased (as opposed to being manually added or allocated from a + * subscription), this endpoint returns the invoices that were created to charge the customer + * for the credit block. For credit blocks with payment schedules spanning multiple periods + * (e.g., monthly payments over 12 months), multiple invoices will be returned. + * + * If the credit block was not purchased (e.g., manual increment, allocation), an empty invoices + * list is returned. + * + * **Note: This endpoint is currently experimental and its interface may change in future + * releases. Please contact support before building production integrations against this + * endpoint.** + */ + fun listInvoices(blockId: String): CreditBlockListInvoicesResponse = + listInvoices(blockId, CreditBlockListInvoicesParams.none()) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CreditBlockListInvoicesResponse = + listInvoices(params.toBuilder().blockId(blockId).build(), requestOptions) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + ): CreditBlockListInvoicesResponse = listInvoices(blockId, params, RequestOptions.none()) + + /** @see listInvoices */ + fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CreditBlockListInvoicesResponse + + /** @see listInvoices */ + fun listInvoices(params: CreditBlockListInvoicesParams): CreditBlockListInvoicesResponse = + listInvoices(params, RequestOptions.none()) + + /** @see listInvoices */ + fun listInvoices( + blockId: String, + requestOptions: RequestOptions, + ): CreditBlockListInvoicesResponse = + listInvoices(blockId, CreditBlockListInvoicesParams.none(), requestOptions) + /** * A view of [CreditBlockService] that provides access to raw HTTP responses for each method. */ @@ -196,5 +247,52 @@ interface CreditBlockService { @MustBeClosed fun delete(blockId: String, requestOptions: RequestOptions): HttpResponse = delete(blockId, CreditBlockDeleteParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /credit_blocks/{block_id}/invoices`, but is + * otherwise the same as [CreditBlockService.listInvoices]. + */ + @MustBeClosed + fun listInvoices(blockId: String): HttpResponseFor = + listInvoices(blockId, CreditBlockListInvoicesParams.none()) + + /** @see listInvoices */ + @MustBeClosed + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + listInvoices(params.toBuilder().blockId(blockId).build(), requestOptions) + + /** @see listInvoices */ + @MustBeClosed + fun listInvoices( + blockId: String, + params: CreditBlockListInvoicesParams = CreditBlockListInvoicesParams.none(), + ): HttpResponseFor = + listInvoices(blockId, params, RequestOptions.none()) + + /** @see listInvoices */ + @MustBeClosed + fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see listInvoices */ + @MustBeClosed + fun listInvoices( + params: CreditBlockListInvoicesParams + ): HttpResponseFor = + listInvoices(params, RequestOptions.none()) + + /** @see listInvoices */ + @MustBeClosed + fun listInvoices( + blockId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + listInvoices(blockId, CreditBlockListInvoicesParams.none(), requestOptions) } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockServiceImpl.kt index d5cac1cc2..f4f6d4757 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditBlockServiceImpl.kt @@ -18,6 +18,8 @@ import com.withorb.api.core.http.json import com.withorb.api.core.http.parseable import com.withorb.api.core.prepare import com.withorb.api.models.CreditBlockDeleteParams +import com.withorb.api.models.CreditBlockListInvoicesParams +import com.withorb.api.models.CreditBlockListInvoicesResponse import com.withorb.api.models.CreditBlockRetrieveParams import com.withorb.api.models.CreditBlockRetrieveResponse import java.util.function.Consumer @@ -47,6 +49,13 @@ class CreditBlockServiceImpl internal constructor(private val clientOptions: Cli withRawResponse().delete(params, requestOptions) } + override fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions, + ): CreditBlockListInvoicesResponse = + // get /credit_blocks/{block_id}/invoices + withRawResponse().listInvoices(params, requestOptions).parse() + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : CreditBlockService.WithRawResponse { @@ -113,5 +122,35 @@ class CreditBlockServiceImpl internal constructor(private val clientOptions: Cli response.use { deleteHandler.handle(it) } } } + + private val listInvoicesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun listInvoices( + params: CreditBlockListInvoicesParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("blockId", params.blockId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("credit_blocks", params._pathParam(0), "invoices") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listInvoicesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt index 7d689c82a..698af6386 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt @@ -14,6 +14,8 @@ import com.withorb.api.models.InvoiceFetchParams import com.withorb.api.models.InvoiceFetchUpcomingParams import com.withorb.api.models.InvoiceFetchUpcomingResponse import com.withorb.api.models.InvoiceIssueParams +import com.withorb.api.models.InvoiceIssueSummaryParams +import com.withorb.api.models.InvoiceIssueSummaryResponse import com.withorb.api.models.InvoiceListPage import com.withorb.api.models.InvoiceListParams import com.withorb.api.models.InvoiceListSummaryPage @@ -215,6 +217,50 @@ interface InvoiceService { fun issue(invoiceId: String, requestOptions: RequestOptions): Invoice = issue(invoiceId, InvoiceIssueParams.none(), requestOptions) + /** + * This endpoint allows an eligible invoice to be issued manually. This is only possible with + * invoices where status is `draft`, `will_auto_issue` is false, and an `eligible_to_issue_at` + * is a time in the past. Issuing an invoice could possibly trigger side effects, some of which + * could be customer-visible (e.g. sending emails, auto-collecting payment, syncing the invoice + * to external providers, etc). + * + * This is a lighter-weight alternative to the issue invoice endpoint, returning an invoice + * summary without any line item details. + */ + fun issueSummary(invoiceId: String): InvoiceIssueSummaryResponse = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none()) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InvoiceIssueSummaryResponse = + issueSummary(params.toBuilder().invoiceId(invoiceId).build(), requestOptions) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + ): InvoiceIssueSummaryResponse = issueSummary(invoiceId, params, RequestOptions.none()) + + /** @see issueSummary */ + fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InvoiceIssueSummaryResponse + + /** @see issueSummary */ + fun issueSummary(params: InvoiceIssueSummaryParams): InvoiceIssueSummaryResponse = + issueSummary(params, RequestOptions.none()) + + /** @see issueSummary */ + fun issueSummary( + invoiceId: String, + requestOptions: RequestOptions, + ): InvoiceIssueSummaryResponse = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none(), requestOptions) + /** * This is a lighter-weight endpoint that returns a list of all * [`Invoice`](/core-concepts#invoice) summaries for an account in a list format. @@ -563,6 +609,53 @@ interface InvoiceService { fun issue(invoiceId: String, requestOptions: RequestOptions): HttpResponseFor = issue(invoiceId, InvoiceIssueParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `post /invoices/summary/{invoice_id}/issue`, but is + * otherwise the same as [InvoiceService.issueSummary]. + */ + @MustBeClosed + fun issueSummary(invoiceId: String): HttpResponseFor = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none()) + + /** @see issueSummary */ + @MustBeClosed + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + issueSummary(params.toBuilder().invoiceId(invoiceId).build(), requestOptions) + + /** @see issueSummary */ + @MustBeClosed + fun issueSummary( + invoiceId: String, + params: InvoiceIssueSummaryParams = InvoiceIssueSummaryParams.none(), + ): HttpResponseFor = + issueSummary(invoiceId, params, RequestOptions.none()) + + /** @see issueSummary */ + @MustBeClosed + fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see issueSummary */ + @MustBeClosed + fun issueSummary( + params: InvoiceIssueSummaryParams + ): HttpResponseFor = + issueSummary(params, RequestOptions.none()) + + /** @see issueSummary */ + @MustBeClosed + fun issueSummary( + invoiceId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + issueSummary(invoiceId, InvoiceIssueSummaryParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /invoices/summary`, but is otherwise the same as * [InvoiceService.listSummary]. 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 38ee69982..990df0c51 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 @@ -24,6 +24,8 @@ import com.withorb.api.models.InvoiceFetchParams import com.withorb.api.models.InvoiceFetchUpcomingParams import com.withorb.api.models.InvoiceFetchUpcomingResponse import com.withorb.api.models.InvoiceIssueParams +import com.withorb.api.models.InvoiceIssueSummaryParams +import com.withorb.api.models.InvoiceIssueSummaryResponse import com.withorb.api.models.InvoiceListPage import com.withorb.api.models.InvoiceListPageResponse import com.withorb.api.models.InvoiceListParams @@ -84,6 +86,13 @@ class InvoiceServiceImpl internal constructor(private val clientOptions: ClientO // post /invoices/{invoice_id}/issue withRawResponse().issue(params, requestOptions).parse() + override fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions, + ): InvoiceIssueSummaryResponse = + // post /invoices/summary/{invoice_id}/issue + withRawResponse().issueSummary(params, requestOptions).parse() + override fun listSummary( params: InvoiceListSummaryParams, requestOptions: RequestOptions, @@ -325,6 +334,37 @@ class InvoiceServiceImpl internal constructor(private val clientOptions: ClientO } } + private val issueSummaryHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun issueSummary( + params: InvoiceIssueSummaryParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("invoiceId", params.invoiceId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("invoices", "summary", params._pathParam(0), "issue") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { issueSummaryHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val listSummaryHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseService.kt new file mode 100644 index 000000000..ea030c297 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseService.kt @@ -0,0 +1,338 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseCreateParams +import com.withorb.api.models.LicenseCreateResponse +import com.withorb.api.models.LicenseDeactivateParams +import com.withorb.api.models.LicenseDeactivateResponse +import com.withorb.api.models.LicenseListPage +import com.withorb.api.models.LicenseListParams +import com.withorb.api.models.LicenseRetrieveByExternalIdParams +import com.withorb.api.models.LicenseRetrieveByExternalIdResponse +import com.withorb.api.models.LicenseRetrieveParams +import com.withorb.api.models.LicenseRetrieveResponse +import com.withorb.api.services.blocking.licenses.ExternalLicenseService +import com.withorb.api.services.blocking.licenses.UsageService +import java.util.function.Consumer + +interface LicenseService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): LicenseService + + fun externalLicenses(): ExternalLicenseService + + fun usage(): UsageService + + /** + * This endpoint is used to create a new license for a user. + * + * If a start date is provided, the license will be activated at the **start** of the specified + * date in the customer's timezone. Otherwise, the activation time will default to the **start** + * of the current day in the customer's timezone. + */ + fun create(params: LicenseCreateParams): LicenseCreateResponse = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseCreateResponse + + /** This endpoint is used to fetch a license given an identifier. */ + fun retrieve(licenseId: String): LicenseRetrieveResponse = + retrieve(licenseId, LicenseRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseRetrieveResponse = + retrieve(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + ): LicenseRetrieveResponse = retrieve(licenseId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseRetrieveResponse + + /** @see retrieve */ + fun retrieve(params: LicenseRetrieveParams): LicenseRetrieveResponse = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve(licenseId: String, requestOptions: RequestOptions): LicenseRetrieveResponse = + retrieve(licenseId, LicenseRetrieveParams.none(), requestOptions) + + /** This endpoint returns a list of all licenses for a subscription. */ + fun list(params: LicenseListParams): LicenseListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list( + params: LicenseListParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseListPage + + /** + * This endpoint is used to deactivate an existing license. + * + * If an end date is provided, the license will be deactivated at the **start** of the specified + * date in the customer's timezone. Otherwise, the deactivation time will default to the **end** + * of the current day in the customer's timezone. + */ + fun deactivate(licenseId: String): LicenseDeactivateResponse = + deactivate(licenseId, LicenseDeactivateParams.none()) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseDeactivateResponse = + deactivate(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see deactivate */ + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + ): LicenseDeactivateResponse = deactivate(licenseId, params, RequestOptions.none()) + + /** @see deactivate */ + fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseDeactivateResponse + + /** @see deactivate */ + fun deactivate(params: LicenseDeactivateParams): LicenseDeactivateResponse = + deactivate(params, RequestOptions.none()) + + /** @see deactivate */ + fun deactivate(licenseId: String, requestOptions: RequestOptions): LicenseDeactivateResponse = + deactivate(licenseId, LicenseDeactivateParams.none(), requestOptions) + + /** This endpoint is used to fetch a license given an external license identifier. */ + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + ): LicenseRetrieveByExternalIdResponse = + retrieveByExternalId(externalLicenseId, params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseRetrieveByExternalIdResponse = + retrieveByExternalId( + params.toBuilder().externalLicenseId(externalLicenseId).build(), + requestOptions, + ) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams + ): LicenseRetrieveByExternalIdResponse = retrieveByExternalId(params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseRetrieveByExternalIdResponse + + /** A view of [LicenseService] that provides access to raw HTTP responses for each method. */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): LicenseService.WithRawResponse + + fun externalLicenses(): ExternalLicenseService.WithRawResponse + + fun usage(): UsageService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /licenses`, but is otherwise the same as + * [LicenseService.create]. + */ + @MustBeClosed + fun create(params: LicenseCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /licenses/{license_id}`, but is otherwise the same + * as [LicenseService.retrieve]. + */ + @MustBeClosed + fun retrieve(licenseId: String): HttpResponseFor = + retrieve(licenseId, LicenseRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + licenseId: String, + params: LicenseRetrieveParams = LicenseRetrieveParams.none(), + ): HttpResponseFor = + retrieve(licenseId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve(params: LicenseRetrieveParams): HttpResponseFor = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + licenseId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve(licenseId, LicenseRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /licenses`, but is otherwise the same as + * [LicenseService.list]. + */ + @MustBeClosed + fun list(params: LicenseListParams): HttpResponseFor = + list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: LicenseListParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `post /licenses/{license_id}/deactivate`, but is + * otherwise the same as [LicenseService.deactivate]. + */ + @MustBeClosed + fun deactivate(licenseId: String): HttpResponseFor = + deactivate(licenseId, LicenseDeactivateParams.none()) + + /** @see deactivate */ + @MustBeClosed + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + deactivate(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see deactivate */ + @MustBeClosed + fun deactivate( + licenseId: String, + params: LicenseDeactivateParams = LicenseDeactivateParams.none(), + ): HttpResponseFor = + deactivate(licenseId, params, RequestOptions.none()) + + /** @see deactivate */ + @MustBeClosed + fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see deactivate */ + @MustBeClosed + fun deactivate( + params: LicenseDeactivateParams + ): HttpResponseFor = deactivate(params, RequestOptions.none()) + + /** @see deactivate */ + @MustBeClosed + fun deactivate( + licenseId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + deactivate(licenseId, LicenseDeactivateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get + * /licenses/external_license_id/{external_license_id}`, but is otherwise the same as + * [LicenseService.retrieveByExternalId]. + */ + @MustBeClosed + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + ): HttpResponseFor = + retrieveByExternalId(externalLicenseId, params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + @MustBeClosed + fun retrieveByExternalId( + externalLicenseId: String, + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieveByExternalId( + params.toBuilder().externalLicenseId(externalLicenseId).build(), + requestOptions, + ) + + /** @see retrieveByExternalId */ + @MustBeClosed + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams + ): HttpResponseFor = + retrieveByExternalId(params, RequestOptions.none()) + + /** @see retrieveByExternalId */ + @MustBeClosed + fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseServiceImpl.kt new file mode 100644 index 000000000..e3b548f3d --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseServiceImpl.kt @@ -0,0 +1,269 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.json +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepare +import com.withorb.api.models.LicenseCreateParams +import com.withorb.api.models.LicenseCreateResponse +import com.withorb.api.models.LicenseDeactivateParams +import com.withorb.api.models.LicenseDeactivateResponse +import com.withorb.api.models.LicenseListPage +import com.withorb.api.models.LicenseListPageResponse +import com.withorb.api.models.LicenseListParams +import com.withorb.api.models.LicenseRetrieveByExternalIdParams +import com.withorb.api.models.LicenseRetrieveByExternalIdResponse +import com.withorb.api.models.LicenseRetrieveParams +import com.withorb.api.models.LicenseRetrieveResponse +import com.withorb.api.services.blocking.licenses.ExternalLicenseService +import com.withorb.api.services.blocking.licenses.ExternalLicenseServiceImpl +import com.withorb.api.services.blocking.licenses.UsageService +import com.withorb.api.services.blocking.licenses.UsageServiceImpl +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class LicenseServiceImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseService { + + private val withRawResponse: LicenseService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + private val externalLicenses: ExternalLicenseService by lazy { + ExternalLicenseServiceImpl(clientOptions) + } + + private val usage: UsageService by lazy { UsageServiceImpl(clientOptions) } + + override fun withRawResponse(): LicenseService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): LicenseService = + LicenseServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun externalLicenses(): ExternalLicenseService = externalLicenses + + override fun usage(): UsageService = usage + + override fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions, + ): LicenseCreateResponse = + // post /licenses + withRawResponse().create(params, requestOptions).parse() + + override fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions, + ): LicenseRetrieveResponse = + // get /licenses/{license_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun list(params: LicenseListParams, requestOptions: RequestOptions): LicenseListPage = + // get /licenses + withRawResponse().list(params, requestOptions).parse() + + override fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions, + ): LicenseDeactivateResponse = + // post /licenses/{license_id}/deactivate + withRawResponse().deactivate(params, requestOptions).parse() + + override fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions, + ): LicenseRetrieveByExternalIdResponse = + // get /licenses/external_license_id/{external_license_id} + withRawResponse().retrieveByExternalId(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + private val externalLicenses: ExternalLicenseService.WithRawResponse by lazy { + ExternalLicenseServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val usage: UsageService.WithRawResponse by lazy { + UsageServiceImpl.WithRawResponseImpl(clientOptions) + } + + override fun withOptions( + modifier: Consumer + ): LicenseService.WithRawResponse = + LicenseServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun externalLicenses(): ExternalLicenseService.WithRawResponse = externalLicenses + + override fun usage(): UsageService.WithRawResponse = usage + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: LicenseCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: LicenseRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseId", params.licenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: LicenseListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + LicenseListPage.builder() + .service(LicenseServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + + private val deactivateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun deactivate( + params: LicenseDeactivateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseId", params.licenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", params._pathParam(0), "deactivate") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { deactivateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val retrieveByExternalIdHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieveByExternalId( + params: LicenseRetrieveByExternalIdParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("externalLicenseId", params.externalLicenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", "external_license_id", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveByExternalIdHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseTypeService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseTypeService.kt new file mode 100644 index 000000000..a0375105c --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseTypeService.kt @@ -0,0 +1,209 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseTypeCreateParams +import com.withorb.api.models.LicenseTypeCreateResponse +import com.withorb.api.models.LicenseTypeListPage +import com.withorb.api.models.LicenseTypeListParams +import com.withorb.api.models.LicenseTypeRetrieveParams +import com.withorb.api.models.LicenseTypeRetrieveResponse +import java.util.function.Consumer + +interface LicenseTypeService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): LicenseTypeService + + /** + * This endpoint is used to create a new license type. + * + * License types are used to group licenses and define billing behavior. Each license type has a + * name and a grouping key that determines how metrics are aggregated for billing purposes. + */ + fun create(params: LicenseTypeCreateParams): LicenseTypeCreateResponse = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseTypeCreateResponse + + /** + * This endpoint returns a license type identified by its license_type_id. + * + * Use this endpoint to retrieve details about a specific license type, including its name and + * grouping key. + */ + fun retrieve(licenseTypeId: String): LicenseTypeRetrieveResponse = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseTypeRetrieveResponse = + retrieve(params.toBuilder().licenseTypeId(licenseTypeId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + ): LicenseTypeRetrieveResponse = retrieve(licenseTypeId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseTypeRetrieveResponse + + /** @see retrieve */ + fun retrieve(params: LicenseTypeRetrieveParams): LicenseTypeRetrieveResponse = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + licenseTypeId: String, + requestOptions: RequestOptions, + ): LicenseTypeRetrieveResponse = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none(), requestOptions) + + /** + * This endpoint returns a list of all license types configured for the account, ordered in + * ascending order by creation time. + * + * License types are used to group licenses and define billing behavior. Each license type has a + * name and a grouping key that determines how metrics are aggregated for billing purposes. + */ + fun list(): LicenseTypeListPage = list(LicenseTypeListParams.none()) + + /** @see list */ + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseTypeListPage + + /** @see list */ + fun list(params: LicenseTypeListParams = LicenseTypeListParams.none()): LicenseTypeListPage = + list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): LicenseTypeListPage = + list(LicenseTypeListParams.none(), requestOptions) + + /** + * A view of [LicenseTypeService] that provides access to raw HTTP responses for each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): LicenseTypeService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /license_types`, but is otherwise the same as + * [LicenseTypeService.create]. + */ + @MustBeClosed + fun create(params: LicenseTypeCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /license_types/{license_type_id}`, but is otherwise + * the same as [LicenseTypeService.retrieve]. + */ + @MustBeClosed + fun retrieve(licenseTypeId: String): HttpResponseFor = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve(params.toBuilder().licenseTypeId(licenseTypeId).build(), requestOptions) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + licenseTypeId: String, + params: LicenseTypeRetrieveParams = LicenseTypeRetrieveParams.none(), + ): HttpResponseFor = + retrieve(licenseTypeId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: LicenseTypeRetrieveParams + ): HttpResponseFor = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + licenseTypeId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve(licenseTypeId, LicenseTypeRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /license_types`, but is otherwise the same as + * [LicenseTypeService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = list(LicenseTypeListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: LicenseTypeListParams = LicenseTypeListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(LicenseTypeListParams.none(), requestOptions) + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseTypeServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseTypeServiceImpl.kt new file mode 100644 index 000000000..15fc754cc --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/LicenseTypeServiceImpl.kt @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.json +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepare +import com.withorb.api.models.LicenseTypeCreateParams +import com.withorb.api.models.LicenseTypeCreateResponse +import com.withorb.api.models.LicenseTypeListPage +import com.withorb.api.models.LicenseTypeListPageResponse +import com.withorb.api.models.LicenseTypeListParams +import com.withorb.api.models.LicenseTypeRetrieveParams +import com.withorb.api.models.LicenseTypeRetrieveResponse +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class LicenseTypeServiceImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseTypeService { + + private val withRawResponse: LicenseTypeService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): LicenseTypeService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): LicenseTypeService = + LicenseTypeServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions, + ): LicenseTypeCreateResponse = + // post /license_types + withRawResponse().create(params, requestOptions).parse() + + override fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions, + ): LicenseTypeRetrieveResponse = + // get /license_types/{license_type_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun list( + params: LicenseTypeListParams, + requestOptions: RequestOptions, + ): LicenseTypeListPage = + // get /license_types + withRawResponse().list(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + LicenseTypeService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): LicenseTypeService.WithRawResponse = + LicenseTypeServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: LicenseTypeCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("license_types") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: LicenseTypeRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseTypeId", params.licenseTypeId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("license_types", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: LicenseTypeListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("license_types") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + LicenseTypeListPage.builder() + .service(LicenseTypeServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditService.kt index 3b33b59ad..262b354c5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditService.kt @@ -40,6 +40,11 @@ interface CreditService { * * Note that `currency` defaults to credits if not specified. To use a real world currency, set * `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the `effective_date[gte]`, + * `effective_date[gt]`, `effective_date[lt]`, and `effective_date[lte]` query parameters. This + * filters on when the credit block becomes effective, which may differ from creation time for + * backdated credits. */ fun list(customerId: String): CustomerCreditListPage = list(customerId, CustomerCreditListParams.none()) @@ -80,6 +85,11 @@ interface CreditService { * * Note that `currency` defaults to credits if not specified. To use a real world currency, set * `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the `effective_date[gte]`, + * `effective_date[gt]`, `effective_date[lt]`, and `effective_date[lte]` query parameters. This + * filters on when the credit block becomes effective, which may differ from creation time for + * backdated credits. */ fun listByExternalId(externalCustomerId: String): CustomerCreditListByExternalIdPage = listByExternalId(externalCustomerId, CustomerCreditListByExternalIdParams.none()) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt index c72bb7243..6ce6dbbe0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt @@ -54,10 +54,8 @@ interface LedgerService { * * As usage for a customer is reported into Orb, credits may be deducted according to the * customer's plan configuration. An automated deduction of this type will result in a ledger - * entry, also with a starting and ending balance. In order to provide better tracing - * capabilities for automatic deductions, Orb always associates each automatic deduction with - * the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place - * and to ensure that credits are never deducted without an associated usage event. + * entry, also with a starting and ending balance. Each day's usage for a particular price, + * invoice, and block will be grouped into a single entry. * * By default, Orb uses an algorithm that automatically deducts from the *soonest expiring * credit block* first in order to ensure that all credits are utilized appropriately. As an @@ -176,7 +174,8 @@ interface LedgerService { * you pass `invoice_settings` in the body of this request, Orb will also generate a one-off * invoice for the customer for the credits pre-purchase. Note that you _must_ provide the * `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying - * the cost basis with the number of credit units added. + * the cost basis with the number of credit units added. Additionally, Orb also enforces invoice + * generation when a non-zero `per_unit_cost_basis` value is provided. * * ## Deducting Credits * Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. @@ -300,7 +299,8 @@ interface LedgerService { * you pass `invoice_settings` in the body of this request, Orb will also generate a one-off * invoice for the customer for the credits pre-purchase. Note that you _must_ provide the * `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying - * the cost basis with the number of credit units added. + * the cost basis with the number of credit units added. Additionally, Orb also enforces invoice + * generation when a non-zero `per_unit_cost_basis` value is provided. * * ## Deducting Credits * Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. @@ -409,10 +409,8 @@ interface LedgerService { * * As usage for a customer is reported into Orb, credits may be deducted according to the * customer's plan configuration. An automated deduction of this type will result in a ledger - * entry, also with a starting and ending balance. In order to provide better tracing - * capabilities for automatic deductions, Orb always associates each automatic deduction with - * the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place - * and to ensure that credits are never deducted without an associated usage event. + * entry, also with a starting and ending balance. Each day's usage for a particular price, + * invoice, and block will be grouped into a single entry. * * By default, Orb uses an algorithm that automatically deducts from the *soonest expiring * credit block* first in order to ensure that all credits are utilized appropriately. As an diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseService.kt new file mode 100644 index 000000000..1356c2da5 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseService.kt @@ -0,0 +1,110 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking.licenses + +import com.google.errorprone.annotations.MustBeClosed +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseExternalLicenseGetUsageParams +import com.withorb.api.models.LicenseExternalLicenseGetUsageResponse +import java.util.function.Consumer + +interface ExternalLicenseService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): ExternalLicenseService + + /** + * Returns usage and remaining credits for a license identified by its external license ID. + * + * Date range defaults to the current billing period if not specified. + */ + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + ): LicenseExternalLicenseGetUsageResponse = + getUsage(externalLicenseId, params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseExternalLicenseGetUsageResponse = + getUsage(params.toBuilder().externalLicenseId(externalLicenseId).build(), requestOptions) + + /** @see getUsage */ + fun getUsage( + params: LicenseExternalLicenseGetUsageParams + ): LicenseExternalLicenseGetUsageResponse = getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseExternalLicenseGetUsageResponse + + /** + * A view of [ExternalLicenseService] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): ExternalLicenseService.WithRawResponse + + /** + * Returns a raw HTTP response for `get + * /licenses/external_licenses/{external_license_id}/usage`, but is otherwise the same as + * [ExternalLicenseService.getUsage]. + */ + @MustBeClosed + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + ): HttpResponseFor = + getUsage(externalLicenseId, params, RequestOptions.none()) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + externalLicenseId: String, + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getUsage( + params.toBuilder().externalLicenseId(externalLicenseId).build(), + requestOptions, + ) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + params: LicenseExternalLicenseGetUsageParams + ): HttpResponseFor = + getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseServiceImpl.kt new file mode 100644 index 000000000..58963b23c --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseServiceImpl.kt @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking.licenses + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepare +import com.withorb.api.models.LicenseExternalLicenseGetUsageParams +import com.withorb.api.models.LicenseExternalLicenseGetUsageResponse +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class ExternalLicenseServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ExternalLicenseService { + + private val withRawResponse: ExternalLicenseService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ExternalLicenseService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ExternalLicenseService = + ExternalLicenseServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions, + ): LicenseExternalLicenseGetUsageResponse = + // get /licenses/external_licenses/{external_license_id}/usage + withRawResponse().getUsage(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ExternalLicenseService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): ExternalLicenseService.WithRawResponse = + ExternalLicenseServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val getUsageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getUsage( + params: LicenseExternalLicenseGetUsageParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("externalLicenseId", params.externalLicenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", "external_licenses", params._pathParam(0), "usage") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getUsageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/UsageService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/UsageService.kt new file mode 100644 index 000000000..2a3f5ea9e --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/UsageService.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking.licenses + +import com.google.errorprone.annotations.MustBeClosed +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.models.LicenseUsageGetAllUsageParams +import com.withorb.api.models.LicenseUsageGetAllUsageResponse +import com.withorb.api.models.LicenseUsageGetUsageParams +import com.withorb.api.models.LicenseUsageGetUsageResponse +import java.util.function.Consumer + +interface UsageService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): UsageService + + /** + * Returns usage and remaining credits for all licenses of a given type on a subscription. + * + * Date range defaults to the current billing period if not specified. + */ + fun getAllUsage(params: LicenseUsageGetAllUsageParams): LicenseUsageGetAllUsageResponse = + getAllUsage(params, RequestOptions.none()) + + /** @see getAllUsage */ + fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseUsageGetAllUsageResponse + + /** + * Returns usage and remaining credits for a specific license over a date range. + * + * Date range defaults to the current billing period if not specified. + */ + fun getUsage(licenseId: String): LicenseUsageGetUsageResponse = + getUsage(licenseId, LicenseUsageGetUsageParams.none()) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseUsageGetUsageResponse = + getUsage(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see getUsage */ + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + ): LicenseUsageGetUsageResponse = getUsage(licenseId, params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LicenseUsageGetUsageResponse + + /** @see getUsage */ + fun getUsage(params: LicenseUsageGetUsageParams): LicenseUsageGetUsageResponse = + getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + fun getUsage(licenseId: String, requestOptions: RequestOptions): LicenseUsageGetUsageResponse = + getUsage(licenseId, LicenseUsageGetUsageParams.none(), requestOptions) + + /** A view of [UsageService] that provides access to raw HTTP responses for each method. */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): UsageService.WithRawResponse + + /** + * Returns a raw HTTP response for `get /licenses/usage`, but is otherwise the same as + * [UsageService.getAllUsage]. + */ + @MustBeClosed + fun getAllUsage( + params: LicenseUsageGetAllUsageParams + ): HttpResponseFor = + getAllUsage(params, RequestOptions.none()) + + /** @see getAllUsage */ + @MustBeClosed + fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /licenses/{license_id}/usage`, but is otherwise the + * same as [UsageService.getUsage]. + */ + @MustBeClosed + fun getUsage(licenseId: String): HttpResponseFor = + getUsage(licenseId, LicenseUsageGetUsageParams.none()) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getUsage(params.toBuilder().licenseId(licenseId).build(), requestOptions) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + licenseId: String, + params: LicenseUsageGetUsageParams = LicenseUsageGetUsageParams.none(), + ): HttpResponseFor = + getUsage(licenseId, params, RequestOptions.none()) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + params: LicenseUsageGetUsageParams + ): HttpResponseFor = getUsage(params, RequestOptions.none()) + + /** @see getUsage */ + @MustBeClosed + fun getUsage( + licenseId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getUsage(licenseId, LicenseUsageGetUsageParams.none(), requestOptions) + } +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/UsageServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/UsageServiceImpl.kt new file mode 100644 index 000000000..fac19c82b --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/licenses/UsageServiceImpl.kt @@ -0,0 +1,121 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking.licenses + +import com.withorb.api.core.ClientOptions +import com.withorb.api.core.RequestOptions +import com.withorb.api.core.checkRequired +import com.withorb.api.core.handlers.errorBodyHandler +import com.withorb.api.core.handlers.errorHandler +import com.withorb.api.core.handlers.jsonHandler +import com.withorb.api.core.http.HttpMethod +import com.withorb.api.core.http.HttpRequest +import com.withorb.api.core.http.HttpResponse +import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.http.HttpResponseFor +import com.withorb.api.core.http.parseable +import com.withorb.api.core.prepare +import com.withorb.api.models.LicenseUsageGetAllUsageParams +import com.withorb.api.models.LicenseUsageGetAllUsageResponse +import com.withorb.api.models.LicenseUsageGetUsageParams +import com.withorb.api.models.LicenseUsageGetUsageResponse +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class UsageServiceImpl internal constructor(private val clientOptions: ClientOptions) : + UsageService { + + private val withRawResponse: UsageService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): UsageService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): UsageService = + UsageServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions, + ): LicenseUsageGetAllUsageResponse = + // get /licenses/usage + withRawResponse().getAllUsage(params, requestOptions).parse() + + override fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions, + ): LicenseUsageGetUsageResponse = + // get /licenses/{license_id}/usage + withRawResponse().getUsage(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + UsageService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): UsageService.WithRawResponse = + UsageServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val getAllUsageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getAllUsage( + params: LicenseUsageGetAllUsageParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", "usage") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getAllUsageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getUsageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getUsage( + params: LicenseUsageGetUsageParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("licenseId", params.licenseId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("licenses", params._pathParam(0), "usage") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getUsageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/TestServerExtension.kt b/orb-java-core/src/test/kotlin/com/withorb/api/TestServerExtension.kt index 4dd94b267..97c34c8f5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/TestServerExtension.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/TestServerExtension.kt @@ -15,25 +15,12 @@ class TestServerExtension : BeforeAllCallback, ExecutionCondition { } catch (e: Exception) { throw RuntimeException( """ - The test suite will not run without a mock Prism server running against your OpenAPI spec. + The test suite will not run without a mock server running against your OpenAPI spec. You can set the environment variable `SKIP_MOCK_TESTS` to `true` to skip running any tests that require the mock server. - To fix: - - 1. Install Prism (requires Node 16+): - - With npm: - $ npm install -g @stoplight/prism-cli - - With yarn: - $ yarn global add @stoplight/prism-cli - - 2. Run the mock server - - To run the server, pass in the path of your OpenAPI spec to the prism command: - $ prism mock path/to/your.openapi.yml + To fix run `./scripts/mock` in a separate terminal. """ .trimIndent(), e, diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/core/ObjectMappersTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/core/ObjectMappersTest.kt index a8bc18d22..0538190b8 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/core/ObjectMappersTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/core/ObjectMappersTest.kt @@ -3,12 +3,14 @@ package com.withorb.api.core import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.exc.MismatchedInputException import com.fasterxml.jackson.module.kotlin.readValue +import java.time.LocalDate +import java.time.LocalTime import java.time.OffsetDateTime +import java.time.ZoneOffset import kotlin.reflect.KClass import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.catchThrowable import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.EnumSource import org.junitpioneer.jupiter.cartesian.CartesianTest @@ -72,11 +74,34 @@ internal class ObjectMappersTest { } } - enum class LenientOffsetDateTimeTestCase(val string: String) { - DATE("1998-04-21"), - DATE_TIME("1998-04-21T04:00:00"), - ZONED_DATE_TIME_1("1998-04-21T04:00:00+03:00"), - ZONED_DATE_TIME_2("1998-04-21T04:00:00Z"), + enum class LenientOffsetDateTimeTestCase( + val string: String, + val expectedOffsetDateTime: OffsetDateTime, + ) { + DATE( + "1998-04-21", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(0, 0), ZoneOffset.UTC), + ), + DATE_TIME( + "1998-04-21T04:00:00", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC), + ), + ZONED_DATE_TIME_1( + "1998-04-21T04:00:00+03:00", + expectedOffsetDateTime = + OffsetDateTime.of( + LocalDate.of(1998, 4, 21), + LocalTime.of(4, 0), + ZoneOffset.ofHours(3), + ), + ), + ZONED_DATE_TIME_2( + "1998-04-21T04:00:00Z", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC), + ), } @ParameterizedTest @@ -85,6 +110,8 @@ internal class ObjectMappersTest { val jsonMapper = jsonMapper() val json = jsonMapper.writeValueAsString(testCase.string) - assertDoesNotThrow { jsonMapper().readValue(json) } + val offsetDateTime = jsonMapper().readValue(json) + + assertThat(offsetDateTime).isEqualTo(testCase.expectedOffsetDateTime) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AggregatedCostTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AggregatedCostTest.kt index 49e22110c..5cde73367 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AggregatedCostTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AggregatedCostTest.kt @@ -62,6 +62,7 @@ internal class AggregatedCostTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -141,6 +142,13 @@ internal class AggregatedCostTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -201,6 +209,7 @@ internal class AggregatedCostTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -278,6 +287,13 @@ internal class AggregatedCostTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -346,6 +362,7 @@ internal class AggregatedCostTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -425,6 +442,13 @@ internal class AggregatedCostTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListPageResponseTest.kt index 8221015e9..39344d63e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListPageResponseTest.kt @@ -44,6 +44,7 @@ internal class AlertListPageResponseTest { .thresholdValue(0.0) .build() ) + .licenseType(Alert.LicenseType.builder().id("id").build()) .build() ) .paginationMetadata( @@ -79,6 +80,7 @@ internal class AlertListPageResponseTest { .addBalanceAlertStatus( Alert.BalanceAlertStatus.builder().inAlert(true).thresholdValue(0.0).build() ) + .licenseType(Alert.LicenseType.builder().id("id").build()) .build() ) assertThat(alertListPageResponse.paginationMetadata()) @@ -120,6 +122,7 @@ internal class AlertListPageResponseTest { .thresholdValue(0.0) .build() ) + .licenseType(Alert.LicenseType.builder().id("id").build()) .build() ) .paginationMetadata( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertTest.kt index 8a8fc960b..74f495bbb 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertTest.kt @@ -40,6 +40,7 @@ internal class AlertTest { .addBalanceAlertStatus( Alert.BalanceAlertStatus.builder().inAlert(true).thresholdValue(0.0).build() ) + .licenseType(Alert.LicenseType.builder().id("id").build()) .build() assertThat(alert.id()).isEqualTo("XuxCbt7x9L82yyeF") @@ -72,6 +73,7 @@ internal class AlertTest { .containsExactly( Alert.BalanceAlertStatus.builder().inAlert(true).thresholdValue(0.0).build() ) + assertThat(alert.licenseType()).contains(Alert.LicenseType.builder().id("id").build()) } @Test @@ -104,6 +106,7 @@ internal class AlertTest { .addBalanceAlertStatus( Alert.BalanceAlertStatus.builder().inAlert(true).thresholdValue(0.0).build() ) + .licenseType(Alert.LicenseType.builder().id("id").build()) .build() val roundtrippedAlert = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AllocationTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AllocationTest.kt index 5f9611a71..d66705ae7 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AllocationTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AllocationTest.kt @@ -29,6 +29,7 @@ internal class AllocationTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() assertThat(allocation.allowsRollover()).isEqualTo(true) @@ -48,6 +49,7 @@ internal class AllocationTest { .addValue("string") .build() ) + assertThat(allocation.licenseTypeId()).contains("license_type_id") } @Test @@ -70,6 +72,7 @@ internal class AllocationTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() val roundtrippedAllocation = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaCreatePlanVersionParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaCreatePlanVersionParamsTest.kt index 20a36bd30..73f709b41 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaCreatePlanVersionParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaCreatePlanVersionParamsTest.kt @@ -64,6 +64,7 @@ internal class BetaCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -111,6 +112,7 @@ internal class BetaCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -185,6 +187,7 @@ internal class BetaCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -232,6 +235,7 @@ internal class BetaCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -311,6 +315,7 @@ internal class BetaCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -360,6 +365,7 @@ internal class BetaCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -434,6 +440,7 @@ internal class BetaCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -483,6 +490,7 @@ internal class BetaCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -551,6 +559,7 @@ internal class BetaCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -598,6 +607,7 @@ internal class BetaCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -676,6 +686,7 @@ internal class BetaCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -723,6 +734,7 @@ internal class BetaCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParamsTest.kt index d24073fbd..0b0c3f39e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParamsTest.kt @@ -64,6 +64,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -111,6 +112,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -185,6 +187,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -232,6 +235,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -315,6 +319,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -364,6 +369,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -438,6 +444,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -487,6 +494,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -555,6 +563,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -602,6 +611,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -680,6 +690,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -727,6 +738,7 @@ internal class BetaExternalPlanIdCreatePlanVersionParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/BillableMetricTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/BillableMetricTest.kt index 34ac805a9..8faa3e42b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/BillableMetricTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/BillableMetricTest.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.withorb.api.core.JsonValue import com.withorb.api.core.jsonMapper import java.time.OffsetDateTime +import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -45,6 +46,11 @@ internal class BillableMetricTest { ) .name("name") .status(BillableMetric.Status.ACTIVE) + .addParameterDefinition( + BillableMetric.ParameterDefinition.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() assertThat(billableMetric.id()).isEqualTo("id") @@ -79,6 +85,12 @@ internal class BillableMetricTest { ) assertThat(billableMetric.name()).isEqualTo("name") assertThat(billableMetric.status()).isEqualTo(BillableMetric.Status.ACTIVE) + assertThat(billableMetric.parameterDefinitions().getOrNull()) + .containsExactly( + BillableMetric.ParameterDefinition.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) } @Test @@ -116,6 +128,11 @@ internal class BillableMetricTest { ) .name("name") .status(BillableMetric.Status.ACTIVE) + .addParameterDefinition( + BillableMetric.ParameterDefinition.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() val roundtrippedBillableMetric = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/ChangedSubscriptionResourcesTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/ChangedSubscriptionResourcesTest.kt index a013bd44b..5890c5be0 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/ChangedSubscriptionResourcesTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/ChangedSubscriptionResourcesTest.kt @@ -303,6 +303,7 @@ internal class ChangedSubscriptionResourcesTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -394,6 +395,13 @@ internal class ChangedSubscriptionResourcesTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -779,6 +787,7 @@ internal class ChangedSubscriptionResourcesTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -870,6 +879,13 @@ internal class ChangedSubscriptionResourcesTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1256,6 +1272,7 @@ internal class ChangedSubscriptionResourcesTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1339,6 +1356,13 @@ internal class ChangedSubscriptionResourcesTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1713,6 +1737,7 @@ internal class ChangedSubscriptionResourcesTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1796,6 +1821,13 @@ internal class ChangedSubscriptionResourcesTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -2196,6 +2228,7 @@ internal class ChangedSubscriptionResourcesTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2287,6 +2320,13 @@ internal class ChangedSubscriptionResourcesTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -2672,6 +2712,7 @@ internal class ChangedSubscriptionResourcesTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2763,6 +2804,13 @@ internal class ChangedSubscriptionResourcesTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockListInvoicesParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockListInvoicesParamsTest.kt new file mode 100644 index 000000000..a25129148 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockListInvoicesParamsTest.kt @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class CreditBlockListInvoicesParamsTest { + + @Test + fun create() { + CreditBlockListInvoicesParams.builder().blockId("block_id").build() + } + + @Test + fun pathParams() { + val params = CreditBlockListInvoicesParams.builder().blockId("block_id").build() + + assertThat(params._pathParam(0)).isEqualTo("block_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockListInvoicesResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockListInvoicesResponseTest.kt new file mode 100644 index 000000000..6f30c53ee --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockListInvoicesResponseTest.kt @@ -0,0 +1,157 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class CreditBlockListInvoicesResponseTest { + + @Test + fun create() { + val creditBlockListInvoicesResponse = + CreditBlockListInvoicesResponse.builder() + .block( + CreditBlockListInvoicesResponse.Block.builder() + .id("id") + .balance(0.0) + .effectiveDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .expiryDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + CreditBlockListInvoicesResponse.Block.Filter.builder() + .field(CreditBlockListInvoicesResponse.Block.Filter.Field.PRICE_ID) + .operator( + CreditBlockListInvoicesResponse.Block.Filter.Operator.INCLUDES + ) + .addValue("string") + .build() + ) + .maximumInitialBalance(0.0) + .metadata( + CreditBlockListInvoicesResponse.Block.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .perUnitCostBasis("per_unit_cost_basis") + .status(CreditBlockListInvoicesResponse.Block.Status.ACTIVE) + .build() + ) + .addInvoice( + CreditBlockListInvoicesResponse.Invoice.builder() + .id("id") + .customer( + CustomerMinified.builder() + .id("id") + .externalCustomerId("external_customer_id") + .build() + ) + .invoiceNumber("invoice_number") + .status(CreditBlockListInvoicesResponse.Invoice.Status.ISSUED) + .subscription(SubscriptionMinified.builder().id("VDGsT23osdLb84KD").build()) + .build() + ) + .build() + + assertThat(creditBlockListInvoicesResponse.block()) + .isEqualTo( + CreditBlockListInvoicesResponse.Block.builder() + .id("id") + .balance(0.0) + .effectiveDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .expiryDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + CreditBlockListInvoicesResponse.Block.Filter.builder() + .field(CreditBlockListInvoicesResponse.Block.Filter.Field.PRICE_ID) + .operator( + CreditBlockListInvoicesResponse.Block.Filter.Operator.INCLUDES + ) + .addValue("string") + .build() + ) + .maximumInitialBalance(0.0) + .metadata( + CreditBlockListInvoicesResponse.Block.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .perUnitCostBasis("per_unit_cost_basis") + .status(CreditBlockListInvoicesResponse.Block.Status.ACTIVE) + .build() + ) + assertThat(creditBlockListInvoicesResponse.invoices()) + .containsExactly( + CreditBlockListInvoicesResponse.Invoice.builder() + .id("id") + .customer( + CustomerMinified.builder() + .id("id") + .externalCustomerId("external_customer_id") + .build() + ) + .invoiceNumber("invoice_number") + .status(CreditBlockListInvoicesResponse.Invoice.Status.ISSUED) + .subscription(SubscriptionMinified.builder().id("VDGsT23osdLb84KD").build()) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val creditBlockListInvoicesResponse = + CreditBlockListInvoicesResponse.builder() + .block( + CreditBlockListInvoicesResponse.Block.builder() + .id("id") + .balance(0.0) + .effectiveDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .expiryDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + CreditBlockListInvoicesResponse.Block.Filter.builder() + .field(CreditBlockListInvoicesResponse.Block.Filter.Field.PRICE_ID) + .operator( + CreditBlockListInvoicesResponse.Block.Filter.Operator.INCLUDES + ) + .addValue("string") + .build() + ) + .maximumInitialBalance(0.0) + .metadata( + CreditBlockListInvoicesResponse.Block.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .perUnitCostBasis("per_unit_cost_basis") + .status(CreditBlockListInvoicesResponse.Block.Status.ACTIVE) + .build() + ) + .addInvoice( + CreditBlockListInvoicesResponse.Invoice.builder() + .id("id") + .customer( + CustomerMinified.builder() + .id("id") + .externalCustomerId("external_customer_id") + .build() + ) + .invoiceNumber("invoice_number") + .status(CreditBlockListInvoicesResponse.Invoice.Status.ISSUED) + .subscription(SubscriptionMinified.builder().id("VDGsT23osdLb84KD").build()) + .build() + ) + .build() + + val roundtrippedCreditBlockListInvoicesResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(creditBlockListInvoicesResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedCreditBlockListInvoicesResponse) + .isEqualTo(creditBlockListInvoicesResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockRetrieveResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockRetrieveResponseTest.kt index 68c2b96c9..364ef830f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockRetrieveResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditBlockRetrieveResponseTest.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue import com.withorb.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -26,6 +27,11 @@ internal class CreditBlockRetrieveResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CreditBlockRetrieveResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CreditBlockRetrieveResponse.Status.ACTIVE) .build() @@ -45,6 +51,12 @@ internal class CreditBlockRetrieveResponseTest { .build() ) assertThat(creditBlockRetrieveResponse.maximumInitialBalance()).contains(0.0) + assertThat(creditBlockRetrieveResponse.metadata()) + .isEqualTo( + CreditBlockRetrieveResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) assertThat(creditBlockRetrieveResponse.perUnitCostBasis()).contains("per_unit_cost_basis") assertThat(creditBlockRetrieveResponse.status()) .isEqualTo(CreditBlockRetrieveResponse.Status.ACTIVE) @@ -67,6 +79,11 @@ internal class CreditBlockRetrieveResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CreditBlockRetrieveResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CreditBlockRetrieveResponse.Status.ACTIVE) .build() 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 390cc855b..2cf8cd2c2 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 @@ -76,6 +76,7 @@ internal class CustomerCostListByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -167,6 +168,13 @@ internal class CustomerCostListByExternalIdResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -238,6 +246,7 @@ internal class CustomerCostListByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -321,6 +330,13 @@ internal class CustomerCostListByExternalIdResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -403,6 +419,7 @@ internal class CustomerCostListByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -494,6 +511,13 @@ internal class CustomerCostListByExternalIdResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") 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 c27926b62..ff5de40ee 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 @@ -76,6 +76,7 @@ internal class CustomerCostListResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -167,6 +168,13 @@ internal class CustomerCostListResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -238,6 +246,7 @@ internal class CustomerCostListResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -321,6 +330,13 @@ internal class CustomerCostListResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -403,6 +419,7 @@ internal class CustomerCostListResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -494,6 +511,13 @@ internal class CustomerCostListResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParamsTest.kt index 8d29cb30a..1283ee12c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParamsTest.kt @@ -47,6 +47,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdParamsTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) @@ -115,6 +116,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdParamsTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) @@ -169,6 +171,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdParamsTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponseTest.kt index 0c54e65de..707a9e776 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponseTest.kt @@ -244,6 +244,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -335,6 +336,13 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -690,6 +698,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -786,6 +795,13 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParamsTest.kt index 0cf4b256e..6ece3389c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParamsTest.kt @@ -41,6 +41,7 @@ internal class CustomerCreditLedgerCreateEntryParamsTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) @@ -104,6 +105,7 @@ internal class CustomerCreditLedgerCreateEntryParamsTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) @@ -152,6 +154,7 @@ internal class CustomerCreditLedgerCreateEntryParamsTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponseTest.kt index 7c3bc0908..afcc9697b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponseTest.kt @@ -244,6 +244,7 @@ internal class CustomerCreditLedgerCreateEntryResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -335,6 +336,13 @@ internal class CustomerCreditLedgerCreateEntryResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -689,6 +697,7 @@ internal class CustomerCreditLedgerCreateEntryResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -785,6 +794,13 @@ internal class CustomerCreditLedgerCreateEntryResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageResponseTest.kt index 02d6d0a49..e8d42a435 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageResponseTest.kt @@ -262,6 +262,7 @@ internal class CustomerCreditLedgerListByExternalIdPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -367,6 +368,13 @@ internal class CustomerCreditLedgerListByExternalIdPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -734,6 +742,7 @@ internal class CustomerCreditLedgerListByExternalIdPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -839,6 +848,13 @@ internal class CustomerCreditLedgerListByExternalIdPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1209,6 +1225,7 @@ internal class CustomerCreditLedgerListByExternalIdPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1314,6 +1331,13 @@ internal class CustomerCreditLedgerListByExternalIdPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponseTest.kt index bb3293e9a..357b6ee0f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponseTest.kt @@ -244,6 +244,7 @@ internal class CustomerCreditLedgerListByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -335,6 +336,13 @@ internal class CustomerCreditLedgerListByExternalIdResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -689,6 +697,7 @@ internal class CustomerCreditLedgerListByExternalIdResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -785,6 +794,13 @@ internal class CustomerCreditLedgerListByExternalIdResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageResponseTest.kt index d58df0af6..05634410d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageResponseTest.kt @@ -262,6 +262,7 @@ internal class CustomerCreditLedgerListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -367,6 +368,13 @@ internal class CustomerCreditLedgerListPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -734,6 +742,7 @@ internal class CustomerCreditLedgerListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -839,6 +848,13 @@ internal class CustomerCreditLedgerListPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1209,6 +1225,7 @@ internal class CustomerCreditLedgerListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1314,6 +1331,13 @@ internal class CustomerCreditLedgerListPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponseTest.kt index 9d7f24e7b..7b69c234b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponseTest.kt @@ -244,6 +244,7 @@ internal class CustomerCreditLedgerListResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -335,6 +336,13 @@ internal class CustomerCreditLedgerListResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -689,6 +697,7 @@ internal class CustomerCreditLedgerListResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -785,6 +794,13 @@ internal class CustomerCreditLedgerListResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageResponseTest.kt index add48b6d5..b52a00271 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageResponseTest.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue import com.withorb.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -30,6 +31,11 @@ internal class CustomerCreditListByExternalIdPageResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListByExternalIdResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListByExternalIdResponse.Status.ACTIVE) .build() @@ -56,6 +62,11 @@ internal class CustomerCreditListByExternalIdPageResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListByExternalIdResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListByExternalIdResponse.Status.ACTIVE) .build() @@ -85,6 +96,11 @@ internal class CustomerCreditListByExternalIdPageResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListByExternalIdResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListByExternalIdResponse.Status.ACTIVE) .build() 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 c02f88add..a6ee7c823 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.http.QueryParams +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -14,6 +15,10 @@ internal class CustomerCreditListByExternalIdParamsTest { .externalCustomerId("external_customer_id") .currency("currency") .cursor("cursor") + .effectiveDateGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateGte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .includeAllBlocks(true) .limit(1L) .build() @@ -38,6 +43,10 @@ internal class CustomerCreditListByExternalIdParamsTest { .externalCustomerId("external_customer_id") .currency("currency") .cursor("cursor") + .effectiveDateGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateGte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .includeAllBlocks(true) .limit(1L) .build() @@ -49,6 +58,10 @@ internal class CustomerCreditListByExternalIdParamsTest { QueryParams.builder() .put("currency", "currency") .put("cursor", "cursor") + .put("effective_date[gt]", "2019-12-27T18:11:19.117Z") + .put("effective_date[gte]", "2019-12-27T18:11:19.117Z") + .put("effective_date[lt]", "2019-12-27T18:11:19.117Z") + .put("effective_date[lte]", "2019-12-27T18:11:19.117Z") .put("include_all_blocks", "true") .put("limit", "1") .build() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponseTest.kt index ad06a474d..a1b21ef8e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponseTest.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue import com.withorb.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -26,6 +27,11 @@ internal class CustomerCreditListByExternalIdResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListByExternalIdResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListByExternalIdResponse.Status.ACTIVE) .build() @@ -45,6 +51,12 @@ internal class CustomerCreditListByExternalIdResponseTest { .build() ) assertThat(customerCreditListByExternalIdResponse.maximumInitialBalance()).contains(0.0) + assertThat(customerCreditListByExternalIdResponse.metadata()) + .isEqualTo( + CustomerCreditListByExternalIdResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) assertThat(customerCreditListByExternalIdResponse.perUnitCostBasis()) .contains("per_unit_cost_basis") assertThat(customerCreditListByExternalIdResponse.status()) @@ -68,6 +80,11 @@ internal class CustomerCreditListByExternalIdResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListByExternalIdResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListByExternalIdResponse.Status.ACTIVE) .build() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListPageResponseTest.kt index 86c3c5fce..6164150d2 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListPageResponseTest.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue import com.withorb.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -28,6 +29,11 @@ internal class CustomerCreditListPageResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListResponse.Status.ACTIVE) .build() @@ -52,6 +58,11 @@ internal class CustomerCreditListPageResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListResponse.Status.ACTIVE) .build() @@ -79,6 +90,11 @@ internal class CustomerCreditListPageResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListResponse.Status.ACTIVE) .build() 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 35a23e2e9..63dceb213 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.http.QueryParams +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -14,6 +15,10 @@ internal class CustomerCreditListParamsTest { .customerId("customer_id") .currency("currency") .cursor("cursor") + .effectiveDateGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateGte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .includeAllBlocks(true) .limit(1L) .build() @@ -35,6 +40,10 @@ internal class CustomerCreditListParamsTest { .customerId("customer_id") .currency("currency") .cursor("cursor") + .effectiveDateGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateGte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .effectiveDateLte(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .includeAllBlocks(true) .limit(1L) .build() @@ -46,6 +55,10 @@ internal class CustomerCreditListParamsTest { QueryParams.builder() .put("currency", "currency") .put("cursor", "cursor") + .put("effective_date[gt]", "2019-12-27T18:11:19.117Z") + .put("effective_date[gte]", "2019-12-27T18:11:19.117Z") + .put("effective_date[lt]", "2019-12-27T18:11:19.117Z") + .put("effective_date[lte]", "2019-12-27T18:11:19.117Z") .put("include_all_blocks", "true") .put("limit", "1") .build() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListResponseTest.kt index bb1390080..c0f782d24 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListResponseTest.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue import com.withorb.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -26,6 +27,11 @@ internal class CustomerCreditListResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListResponse.Status.ACTIVE) .build() @@ -45,6 +51,12 @@ internal class CustomerCreditListResponseTest { .build() ) assertThat(customerCreditListResponse.maximumInitialBalance()).contains(0.0) + assertThat(customerCreditListResponse.metadata()) + .isEqualTo( + CustomerCreditListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) assertThat(customerCreditListResponse.perUnitCostBasis()).contains("per_unit_cost_basis") assertThat(customerCreditListResponse.status()) .isEqualTo(CustomerCreditListResponse.Status.ACTIVE) @@ -67,6 +79,11 @@ internal class CustomerCreditListResponseTest { .build() ) .maximumInitialBalance(0.0) + .metadata( + CustomerCreditListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .perUnitCostBasis("per_unit_cost_basis") .status(CustomerCreditListResponse.Status.ACTIVE) .build() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/IncrementLedgerEntryTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/IncrementLedgerEntryTest.kt index e432581b5..592a6f4a9 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/IncrementLedgerEntryTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/IncrementLedgerEntryTest.kt @@ -241,6 +241,7 @@ internal class IncrementLedgerEntryTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -332,6 +333,13 @@ internal class IncrementLedgerEntryTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -660,6 +668,7 @@ internal class IncrementLedgerEntryTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -743,6 +752,13 @@ internal class IncrementLedgerEntryTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1080,6 +1096,7 @@ internal class IncrementLedgerEntryTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1171,6 +1188,13 @@ internal class IncrementLedgerEntryTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) 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 7b746db93..092d708ea 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 @@ -186,6 +186,7 @@ internal class InvoiceFetchUpcomingResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -265,6 +266,13 @@ internal class InvoiceFetchUpcomingResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -556,6 +564,7 @@ internal class InvoiceFetchUpcomingResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -633,6 +642,13 @@ internal class InvoiceFetchUpcomingResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -928,6 +944,7 @@ internal class InvoiceFetchUpcomingResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1007,6 +1024,13 @@ internal class InvoiceFetchUpcomingResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueSummaryParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueSummaryParamsTest.kt new file mode 100644 index 000000000..2a52476ca --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueSummaryParamsTest.kt @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InvoiceIssueSummaryParamsTest { + + @Test + fun create() { + InvoiceIssueSummaryParams.builder().invoiceId("invoice_id").synchronous(true).build() + } + + @Test + fun pathParams() { + val params = InvoiceIssueSummaryParams.builder().invoiceId("invoice_id").build() + + assertThat(params._pathParam(0)).isEqualTo("invoice_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + InvoiceIssueSummaryParams.builder().invoiceId("invoice_id").synchronous(true).build() + + val body = params._body() + + assertThat(body.synchronous()).contains(true) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = InvoiceIssueSummaryParams.builder().invoiceId("invoice_id").build() + + val body = params._body() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueSummaryResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueSummaryResponseTest.kt new file mode 100644 index 000000000..507c3eeaf --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueSummaryResponseTest.kt @@ -0,0 +1,401 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.JsonValue +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InvoiceIssueSummaryResponseTest { + + @Test + fun create() { + val invoiceIssueSummaryResponse = + InvoiceIssueSummaryResponse.builder() + .id("id") + .amountDue("8.00") + .autoCollection( + InvoiceIssueSummaryResponse.AutoCollection.builder() + .enabled(true) + .nextAttemptAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .numAttempts(0L) + .previouslyAttemptedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .billingAddress( + Address.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .build() + ) + .createdAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .addCreditNote( + InvoiceIssueSummaryResponse.CreditNote.builder() + .id("id") + .creditNoteNumber("credit_note_number") + .memo("memo") + .reason("reason") + .total("total") + .type("type") + .voidedAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .build() + ) + .currency("USD") + .customer( + CustomerMinified.builder() + .id("id") + .externalCustomerId("external_customer_id") + .build() + ) + .addCustomerBalanceTransaction( + InvoiceIssueSummaryResponse.CustomerBalanceTransaction.builder() + .id("cgZa3SXcsPTVyC4Y") + .action( + InvoiceIssueSummaryResponse.CustomerBalanceTransaction.Action + .APPLIED_TO_INVOICE + ) + .amount("11.00") + .createdAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .creditNote(CreditNoteTiny.builder().id("id").build()) + .description("An optional description") + .endingBalance("22.00") + .invoice(InvoiceTiny.builder().id("gXcsPTVyC4YZa3Sc").build()) + .startingBalance("33.00") + .type(InvoiceIssueSummaryResponse.CustomerBalanceTransaction.Type.INCREMENT) + .build() + ) + .customerTaxId( + CustomerTaxId.builder() + .country(CustomerTaxId.Country.AD) + .type(CustomerTaxId.Type.AD_NRT) + .value("value") + .build() + ) + .dueDate(OffsetDateTime.parse("2022-05-30T07:00:00+00:00")) + .eligibleToIssueAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .hostedInvoiceUrl("hosted_invoice_url") + .invoiceDate(OffsetDateTime.parse("2022-05-01T07:00:00+00:00")) + .invoiceNumber("JYEFHK-00001") + .invoicePdf("https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb") + .invoiceSource(InvoiceIssueSummaryResponse.InvoiceSource.SUBSCRIPTION) + .issueFailedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .issuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .memo("memo") + .metadata( + InvoiceIssueSummaryResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .paidAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addPaymentAttempt( + InvoiceIssueSummaryResponse.PaymentAttempt.builder() + .id("id") + .amount("amount") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .paymentProvider( + InvoiceIssueSummaryResponse.PaymentAttempt.PaymentProvider.STRIPE + ) + .paymentProviderId("payment_provider_id") + .receiptPdf( + "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb" + ) + .succeeded(true) + .build() + ) + .paymentFailedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .paymentStartedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .scheduledIssueAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .shippingAddress( + Address.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .build() + ) + .status(InvoiceIssueSummaryResponse.Status.ISSUED) + .subscription(SubscriptionMinified.builder().id("VDGsT23osdLb84KD").build()) + .syncFailedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .total("8.00") + .voidedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .willAutoIssue(true) + .build() + + assertThat(invoiceIssueSummaryResponse.id()).isEqualTo("id") + assertThat(invoiceIssueSummaryResponse.amountDue()).isEqualTo("8.00") + assertThat(invoiceIssueSummaryResponse.autoCollection()) + .isEqualTo( + InvoiceIssueSummaryResponse.AutoCollection.builder() + .enabled(true) + .nextAttemptAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .numAttempts(0L) + .previouslyAttemptedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + assertThat(invoiceIssueSummaryResponse.billingAddress()) + .contains( + Address.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .build() + ) + assertThat(invoiceIssueSummaryResponse.createdAt()) + .isEqualTo(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + assertThat(invoiceIssueSummaryResponse.creditNotes()) + .containsExactly( + InvoiceIssueSummaryResponse.CreditNote.builder() + .id("id") + .creditNoteNumber("credit_note_number") + .memo("memo") + .reason("reason") + .total("total") + .type("type") + .voidedAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .build() + ) + assertThat(invoiceIssueSummaryResponse.currency()).isEqualTo("USD") + assertThat(invoiceIssueSummaryResponse.customer()) + .isEqualTo( + CustomerMinified.builder() + .id("id") + .externalCustomerId("external_customer_id") + .build() + ) + assertThat(invoiceIssueSummaryResponse.customerBalanceTransactions()) + .containsExactly( + InvoiceIssueSummaryResponse.CustomerBalanceTransaction.builder() + .id("cgZa3SXcsPTVyC4Y") + .action( + InvoiceIssueSummaryResponse.CustomerBalanceTransaction.Action + .APPLIED_TO_INVOICE + ) + .amount("11.00") + .createdAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .creditNote(CreditNoteTiny.builder().id("id").build()) + .description("An optional description") + .endingBalance("22.00") + .invoice(InvoiceTiny.builder().id("gXcsPTVyC4YZa3Sc").build()) + .startingBalance("33.00") + .type(InvoiceIssueSummaryResponse.CustomerBalanceTransaction.Type.INCREMENT) + .build() + ) + assertThat(invoiceIssueSummaryResponse.customerTaxId()) + .contains( + CustomerTaxId.builder() + .country(CustomerTaxId.Country.AD) + .type(CustomerTaxId.Type.AD_NRT) + .value("value") + .build() + ) + assertThat(invoiceIssueSummaryResponse.dueDate()) + .contains(OffsetDateTime.parse("2022-05-30T07:00:00+00:00")) + assertThat(invoiceIssueSummaryResponse.eligibleToIssueAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.hostedInvoiceUrl()).contains("hosted_invoice_url") + assertThat(invoiceIssueSummaryResponse.invoiceDate()) + .isEqualTo(OffsetDateTime.parse("2022-05-01T07:00:00+00:00")) + assertThat(invoiceIssueSummaryResponse.invoiceNumber()).isEqualTo("JYEFHK-00001") + assertThat(invoiceIssueSummaryResponse.invoicePdf()) + .contains("https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb") + assertThat(invoiceIssueSummaryResponse.invoiceSource()) + .isEqualTo(InvoiceIssueSummaryResponse.InvoiceSource.SUBSCRIPTION) + assertThat(invoiceIssueSummaryResponse.issueFailedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.issuedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.memo()).contains("memo") + assertThat(invoiceIssueSummaryResponse.metadata()) + .isEqualTo( + InvoiceIssueSummaryResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + assertThat(invoiceIssueSummaryResponse.paidAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.paymentAttempts()) + .containsExactly( + InvoiceIssueSummaryResponse.PaymentAttempt.builder() + .id("id") + .amount("amount") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .paymentProvider( + InvoiceIssueSummaryResponse.PaymentAttempt.PaymentProvider.STRIPE + ) + .paymentProviderId("payment_provider_id") + .receiptPdf( + "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb" + ) + .succeeded(true) + .build() + ) + assertThat(invoiceIssueSummaryResponse.paymentFailedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.paymentStartedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.scheduledIssueAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.shippingAddress()) + .contains( + Address.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .build() + ) + assertThat(invoiceIssueSummaryResponse.status()) + .isEqualTo(InvoiceIssueSummaryResponse.Status.ISSUED) + assertThat(invoiceIssueSummaryResponse.subscription()) + .contains(SubscriptionMinified.builder().id("VDGsT23osdLb84KD").build()) + assertThat(invoiceIssueSummaryResponse.syncFailedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.total()).isEqualTo("8.00") + assertThat(invoiceIssueSummaryResponse.voidedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(invoiceIssueSummaryResponse.willAutoIssue()).isEqualTo(true) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val invoiceIssueSummaryResponse = + InvoiceIssueSummaryResponse.builder() + .id("id") + .amountDue("8.00") + .autoCollection( + InvoiceIssueSummaryResponse.AutoCollection.builder() + .enabled(true) + .nextAttemptAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .numAttempts(0L) + .previouslyAttemptedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .billingAddress( + Address.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .build() + ) + .createdAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .addCreditNote( + InvoiceIssueSummaryResponse.CreditNote.builder() + .id("id") + .creditNoteNumber("credit_note_number") + .memo("memo") + .reason("reason") + .total("total") + .type("type") + .voidedAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .build() + ) + .currency("USD") + .customer( + CustomerMinified.builder() + .id("id") + .externalCustomerId("external_customer_id") + .build() + ) + .addCustomerBalanceTransaction( + InvoiceIssueSummaryResponse.CustomerBalanceTransaction.builder() + .id("cgZa3SXcsPTVyC4Y") + .action( + InvoiceIssueSummaryResponse.CustomerBalanceTransaction.Action + .APPLIED_TO_INVOICE + ) + .amount("11.00") + .createdAt(OffsetDateTime.parse("2022-05-01T07:01:31+00:00")) + .creditNote(CreditNoteTiny.builder().id("id").build()) + .description("An optional description") + .endingBalance("22.00") + .invoice(InvoiceTiny.builder().id("gXcsPTVyC4YZa3Sc").build()) + .startingBalance("33.00") + .type(InvoiceIssueSummaryResponse.CustomerBalanceTransaction.Type.INCREMENT) + .build() + ) + .customerTaxId( + CustomerTaxId.builder() + .country(CustomerTaxId.Country.AD) + .type(CustomerTaxId.Type.AD_NRT) + .value("value") + .build() + ) + .dueDate(OffsetDateTime.parse("2022-05-30T07:00:00+00:00")) + .eligibleToIssueAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .hostedInvoiceUrl("hosted_invoice_url") + .invoiceDate(OffsetDateTime.parse("2022-05-01T07:00:00+00:00")) + .invoiceNumber("JYEFHK-00001") + .invoicePdf("https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb") + .invoiceSource(InvoiceIssueSummaryResponse.InvoiceSource.SUBSCRIPTION) + .issueFailedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .issuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .memo("memo") + .metadata( + InvoiceIssueSummaryResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .paidAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addPaymentAttempt( + InvoiceIssueSummaryResponse.PaymentAttempt.builder() + .id("id") + .amount("amount") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .paymentProvider( + InvoiceIssueSummaryResponse.PaymentAttempt.PaymentProvider.STRIPE + ) + .paymentProviderId("payment_provider_id") + .receiptPdf( + "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb" + ) + .succeeded(true) + .build() + ) + .paymentFailedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .paymentStartedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .scheduledIssueAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .shippingAddress( + Address.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .build() + ) + .status(InvoiceIssueSummaryResponse.Status.ISSUED) + .subscription(SubscriptionMinified.builder().id("VDGsT23osdLb84KD").build()) + .syncFailedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .total("8.00") + .voidedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .willAutoIssue(true) + .build() + + val roundtrippedInvoiceIssueSummaryResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(invoiceIssueSummaryResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedInvoiceIssueSummaryResponse).isEqualTo(invoiceIssueSummaryResponse) + } +} 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 aaba0feb6..f65103746 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 @@ -87,6 +87,7 @@ internal class InvoiceLineItemCreateResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -161,6 +162,13 @@ internal class InvoiceLineItemCreateResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -266,6 +274,7 @@ internal class InvoiceLineItemCreateResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -340,6 +349,13 @@ internal class InvoiceLineItemCreateResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) ) @@ -451,6 +467,7 @@ internal class InvoiceLineItemCreateResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -525,6 +542,13 @@ internal class InvoiceLineItemCreateResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListPageResponseTest.kt index d29aa1314..69cd680d7 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListPageResponseTest.kt @@ -205,6 +205,7 @@ internal class InvoiceListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -296,6 +297,13 @@ internal class InvoiceListPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -586,6 +594,7 @@ internal class InvoiceListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -669,6 +678,13 @@ internal class InvoiceListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -973,6 +989,7 @@ internal class InvoiceListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1064,6 +1081,13 @@ internal class InvoiceListPageResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) 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 632b5b154..ab8b70256 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 @@ -182,6 +182,7 @@ internal class InvoiceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -261,6 +262,13 @@ internal class InvoiceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -543,6 +551,7 @@ internal class InvoiceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -620,6 +629,13 @@ internal class InvoiceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -904,6 +920,7 @@ internal class InvoiceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -983,6 +1000,13 @@ internal class InvoiceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseCreateParamsTest.kt new file mode 100644 index 000000000..6afad4000 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseCreateParamsTest.kt @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseCreateParamsTest { + + @Test + fun create() { + LicenseCreateParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .endDate(LocalDate.parse("2026-01-27")) + .startDate(LocalDate.parse("2026-01-27")) + .build() + } + + @Test + fun body() { + val params = + LicenseCreateParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .endDate(LocalDate.parse("2026-01-27")) + .startDate(LocalDate.parse("2026-01-27")) + .build() + + val body = params._body() + + assertThat(body.externalLicenseId()).isEqualTo("external_license_id") + assertThat(body.licenseTypeId()).isEqualTo("license_type_id") + assertThat(body.subscriptionId()).isEqualTo("subscription_id") + assertThat(body.endDate()).contains(LocalDate.parse("2026-01-27")) + assertThat(body.startDate()).contains(LocalDate.parse("2026-01-27")) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + LicenseCreateParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + + val body = params._body() + + assertThat(body.externalLicenseId()).isEqualTo("external_license_id") + assertThat(body.licenseTypeId()).isEqualTo("license_type_id") + assertThat(body.subscriptionId()).isEqualTo("subscription_id") + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseCreateResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseCreateResponseTest.kt new file mode 100644 index 000000000..a2b9ff432 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseCreateResponseTest.kt @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseCreateResponseTest { + + @Test + fun create() { + val licenseCreateResponse = + LicenseCreateResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseCreateResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + assertThat(licenseCreateResponse.id()).isEqualTo("id") + assertThat(licenseCreateResponse.endDate()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseCreateResponse.externalLicenseId()).isEqualTo("external_license_id") + assertThat(licenseCreateResponse.licenseTypeId()).isEqualTo("license_type_id") + assertThat(licenseCreateResponse.startDate()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseCreateResponse.status()).isEqualTo(LicenseCreateResponse.Status.ACTIVE) + assertThat(licenseCreateResponse.subscriptionId()).isEqualTo("subscription_id") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseCreateResponse = + LicenseCreateResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseCreateResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + val roundtrippedLicenseCreateResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseCreateResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseCreateResponse).isEqualTo(licenseCreateResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseDeactivateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseDeactivateParamsTest.kt new file mode 100644 index 000000000..55445a395 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseDeactivateParamsTest.kt @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseDeactivateParamsTest { + + @Test + fun create() { + LicenseDeactivateParams.builder() + .licenseId("license_id") + .endDate(LocalDate.parse("2026-01-27")) + .build() + } + + @Test + fun pathParams() { + val params = LicenseDeactivateParams.builder().licenseId("license_id").build() + + assertThat(params._pathParam(0)).isEqualTo("license_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + LicenseDeactivateParams.builder() + .licenseId("license_id") + .endDate(LocalDate.parse("2026-01-27")) + .build() + + val body = params._body() + + assertThat(body.endDate()).contains(LocalDate.parse("2026-01-27")) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = LicenseDeactivateParams.builder().licenseId("license_id").build() + + val body = params._body() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseDeactivateResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseDeactivateResponseTest.kt new file mode 100644 index 000000000..15edeed91 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseDeactivateResponseTest.kt @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseDeactivateResponseTest { + + @Test + fun create() { + val licenseDeactivateResponse = + LicenseDeactivateResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseDeactivateResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + assertThat(licenseDeactivateResponse.id()).isEqualTo("id") + assertThat(licenseDeactivateResponse.endDate()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseDeactivateResponse.externalLicenseId()).isEqualTo("external_license_id") + assertThat(licenseDeactivateResponse.licenseTypeId()).isEqualTo("license_type_id") + assertThat(licenseDeactivateResponse.startDate()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseDeactivateResponse.status()) + .isEqualTo(LicenseDeactivateResponse.Status.ACTIVE) + assertThat(licenseDeactivateResponse.subscriptionId()).isEqualTo("subscription_id") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseDeactivateResponse = + LicenseDeactivateResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseDeactivateResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + val roundtrippedLicenseDeactivateResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseDeactivateResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseDeactivateResponse).isEqualTo(licenseDeactivateResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageParamsTest.kt new file mode 100644 index 000000000..4d04e1783 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageParamsTest.kt @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.http.QueryParams +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseExternalLicenseGetUsageParamsTest { + + @Test + fun create() { + LicenseExternalLicenseGetUsageParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + } + + @Test + fun pathParams() { + val params = + LicenseExternalLicenseGetUsageParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + + assertThat(params._pathParam(0)).isEqualTo("external_license_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun queryParams() { + val params = + LicenseExternalLicenseGetUsageParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("license_type_id", "license_type_id") + .put("subscription_id", "subscription_id") + .put("cursor", "cursor") + .put("end_date", "2019-12-27") + .put("group_by[]", "string") + .put("limit", "1") + .put("start_date", "2019-12-27") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + LicenseExternalLicenseGetUsageParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("license_type_id", "license_type_id") + .put("subscription_id", "subscription_id") + .build() + ) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageResponseTest.kt new file mode 100644 index 000000000..80cf3d8dd --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseExternalLicenseGetUsageResponseTest.kt @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseExternalLicenseGetUsageResponseTest { + + @Test + fun create() { + val licenseExternalLicenseGetUsageResponse = + LicenseExternalLicenseGetUsageResponse.builder() + .addData( + LicenseExternalLicenseGetUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + assertThat(licenseExternalLicenseGetUsageResponse.data()) + .containsExactly( + LicenseExternalLicenseGetUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + assertThat(licenseExternalLicenseGetUsageResponse.paginationMetadata()) + .isEqualTo(PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build()) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseExternalLicenseGetUsageResponse = + LicenseExternalLicenseGetUsageResponse.builder() + .addData( + LicenseExternalLicenseGetUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + val roundtrippedLicenseExternalLicenseGetUsageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseExternalLicenseGetUsageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseExternalLicenseGetUsageResponse) + .isEqualTo(licenseExternalLicenseGetUsageResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListPageResponseTest.kt new file mode 100644 index 000000000..4f9b17d8b --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListPageResponseTest.kt @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseListPageResponseTest { + + @Test + fun create() { + val licenseListPageResponse = + LicenseListPageResponse.builder() + .addData( + LicenseListResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseListResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + assertThat(licenseListPageResponse.data()) + .containsExactly( + LicenseListResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseListResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + ) + assertThat(licenseListPageResponse.paginationMetadata()) + .isEqualTo(PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build()) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseListPageResponse = + LicenseListPageResponse.builder() + .addData( + LicenseListResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseListResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + val roundtrippedLicenseListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseListPageResponse).isEqualTo(licenseListPageResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListParamsTest.kt new file mode 100644 index 000000000..41c62d909 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListParamsTest.kt @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.http.QueryParams +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseListParamsTest { + + @Test + fun create() { + LicenseListParams.builder() + .subscriptionId("subscription_id") + .cursor("cursor") + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .limit(1L) + .status(LicenseListParams.Status.ACTIVE) + .build() + } + + @Test + fun queryParams() { + val params = + LicenseListParams.builder() + .subscriptionId("subscription_id") + .cursor("cursor") + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .limit(1L) + .status(LicenseListParams.Status.ACTIVE) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("subscription_id", "subscription_id") + .put("cursor", "cursor") + .put("external_license_id", "external_license_id") + .put("license_type_id", "license_type_id") + .put("limit", "1") + .put("status", "active") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = LicenseListParams.builder().subscriptionId("subscription_id").build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo(QueryParams.builder().put("subscription_id", "subscription_id").build()) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListResponseTest.kt new file mode 100644 index 000000000..716cdd5b4 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseListResponseTest.kt @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseListResponseTest { + + @Test + fun create() { + val licenseListResponse = + LicenseListResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseListResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + assertThat(licenseListResponse.id()).isEqualTo("id") + assertThat(licenseListResponse.endDate()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseListResponse.externalLicenseId()).isEqualTo("external_license_id") + assertThat(licenseListResponse.licenseTypeId()).isEqualTo("license_type_id") + assertThat(licenseListResponse.startDate()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseListResponse.status()).isEqualTo(LicenseListResponse.Status.ACTIVE) + assertThat(licenseListResponse.subscriptionId()).isEqualTo("subscription_id") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseListResponse = + LicenseListResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseListResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + val roundtrippedLicenseListResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseListResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseListResponse).isEqualTo(licenseListResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdParamsTest.kt new file mode 100644 index 000000000..a1c636dd4 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdParamsTest.kt @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.http.QueryParams +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseRetrieveByExternalIdParamsTest { + + @Test + fun create() { + LicenseRetrieveByExternalIdParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + } + + @Test + fun pathParams() { + val params = + LicenseRetrieveByExternalIdParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + + assertThat(params._pathParam(0)).isEqualTo("external_license_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun queryParams() { + val params = + LicenseRetrieveByExternalIdParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("license_type_id", "license_type_id") + .put("subscription_id", "subscription_id") + .build() + ) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdResponseTest.kt new file mode 100644 index 000000000..c9d7e9b26 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveByExternalIdResponseTest.kt @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseRetrieveByExternalIdResponseTest { + + @Test + fun create() { + val licenseRetrieveByExternalIdResponse = + LicenseRetrieveByExternalIdResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseRetrieveByExternalIdResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + assertThat(licenseRetrieveByExternalIdResponse.id()).isEqualTo("id") + assertThat(licenseRetrieveByExternalIdResponse.endDate()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseRetrieveByExternalIdResponse.externalLicenseId()) + .isEqualTo("external_license_id") + assertThat(licenseRetrieveByExternalIdResponse.licenseTypeId()).isEqualTo("license_type_id") + assertThat(licenseRetrieveByExternalIdResponse.startDate()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseRetrieveByExternalIdResponse.status()) + .isEqualTo(LicenseRetrieveByExternalIdResponse.Status.ACTIVE) + assertThat(licenseRetrieveByExternalIdResponse.subscriptionId()) + .isEqualTo("subscription_id") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseRetrieveByExternalIdResponse = + LicenseRetrieveByExternalIdResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseRetrieveByExternalIdResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + val roundtrippedLicenseRetrieveByExternalIdResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseRetrieveByExternalIdResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseRetrieveByExternalIdResponse) + .isEqualTo(licenseRetrieveByExternalIdResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveParamsTest.kt new file mode 100644 index 000000000..c23771812 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveParamsTest.kt @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseRetrieveParamsTest { + + @Test + fun create() { + LicenseRetrieveParams.builder().licenseId("license_id").build() + } + + @Test + fun pathParams() { + val params = LicenseRetrieveParams.builder().licenseId("license_id").build() + + assertThat(params._pathParam(0)).isEqualTo("license_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveResponseTest.kt new file mode 100644 index 000000000..46bc72488 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseRetrieveResponseTest.kt @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseRetrieveResponseTest { + + @Test + fun create() { + val licenseRetrieveResponse = + LicenseRetrieveResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseRetrieveResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + assertThat(licenseRetrieveResponse.id()).isEqualTo("id") + assertThat(licenseRetrieveResponse.endDate()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseRetrieveResponse.externalLicenseId()).isEqualTo("external_license_id") + assertThat(licenseRetrieveResponse.licenseTypeId()).isEqualTo("license_type_id") + assertThat(licenseRetrieveResponse.startDate()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(licenseRetrieveResponse.status()) + .isEqualTo(LicenseRetrieveResponse.Status.ACTIVE) + assertThat(licenseRetrieveResponse.subscriptionId()).isEqualTo("subscription_id") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseRetrieveResponse = + LicenseRetrieveResponse.builder() + .id("id") + .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .status(LicenseRetrieveResponse.Status.ACTIVE) + .subscriptionId("subscription_id") + .build() + + val roundtrippedLicenseRetrieveResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseRetrieveResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseRetrieveResponse).isEqualTo(licenseRetrieveResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeCreateParamsTest.kt new file mode 100644 index 000000000..4a11b64bd --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeCreateParamsTest.kt @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeCreateParamsTest { + + @Test + fun create() { + LicenseTypeCreateParams.builder().groupingKey("grouping_key").name("name").build() + } + + @Test + fun body() { + val params = + LicenseTypeCreateParams.builder().groupingKey("grouping_key").name("name").build() + + val body = params._body() + + assertThat(body.groupingKey()).isEqualTo("grouping_key") + assertThat(body.name()).isEqualTo("name") + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeCreateResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeCreateResponseTest.kt new file mode 100644 index 000000000..91b78f2bb --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeCreateResponseTest.kt @@ -0,0 +1,44 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeCreateResponseTest { + + @Test + fun create() { + val licenseTypeCreateResponse = + LicenseTypeCreateResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + + assertThat(licenseTypeCreateResponse.id()).isEqualTo("id") + assertThat(licenseTypeCreateResponse.groupingKey()).isEqualTo("grouping_key") + assertThat(licenseTypeCreateResponse.name()).isEqualTo("name") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseTypeCreateResponse = + LicenseTypeCreateResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + + val roundtrippedLicenseTypeCreateResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseTypeCreateResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseTypeCreateResponse).isEqualTo(licenseTypeCreateResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListPageResponseTest.kt new file mode 100644 index 000000000..8462e1fb3 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListPageResponseTest.kt @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeListPageResponseTest { + + @Test + fun create() { + val licenseTypeListPageResponse = + LicenseTypeListPageResponse.builder() + .addData( + LicenseTypeListResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + assertThat(licenseTypeListPageResponse.data()) + .containsExactly( + LicenseTypeListResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) + assertThat(licenseTypeListPageResponse.paginationMetadata()) + .isEqualTo(PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build()) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseTypeListPageResponse = + LicenseTypeListPageResponse.builder() + .addData( + LicenseTypeListResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + val roundtrippedLicenseTypeListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseTypeListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseTypeListPageResponse).isEqualTo(licenseTypeListPageResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListParamsTest.kt new file mode 100644 index 000000000..92c42e709 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListParamsTest.kt @@ -0,0 +1,34 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.http.QueryParams +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeListParamsTest { + + @Test + fun create() { + LicenseTypeListParams.builder().cursor("cursor").limit(1L).build() + } + + @Test + fun queryParams() { + val params = LicenseTypeListParams.builder().cursor("cursor").limit(1L).build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo(QueryParams.builder().put("cursor", "cursor").put("limit", "1").build()) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = LicenseTypeListParams.builder().build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListResponseTest.kt new file mode 100644 index 000000000..0c5c783eb --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeListResponseTest.kt @@ -0,0 +1,44 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeListResponseTest { + + @Test + fun create() { + val licenseTypeListResponse = + LicenseTypeListResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + + assertThat(licenseTypeListResponse.id()).isEqualTo("id") + assertThat(licenseTypeListResponse.groupingKey()).isEqualTo("grouping_key") + assertThat(licenseTypeListResponse.name()).isEqualTo("name") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseTypeListResponse = + LicenseTypeListResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + + val roundtrippedLicenseTypeListResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseTypeListResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseTypeListResponse).isEqualTo(licenseTypeListResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeRetrieveParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeRetrieveParamsTest.kt new file mode 100644 index 000000000..e1d93b327 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeRetrieveParamsTest.kt @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeRetrieveParamsTest { + + @Test + fun create() { + LicenseTypeRetrieveParams.builder().licenseTypeId("license_type_id").build() + } + + @Test + fun pathParams() { + val params = LicenseTypeRetrieveParams.builder().licenseTypeId("license_type_id").build() + + assertThat(params._pathParam(0)).isEqualTo("license_type_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeRetrieveResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeRetrieveResponseTest.kt new file mode 100644 index 000000000..8e7235789 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseTypeRetrieveResponseTest.kt @@ -0,0 +1,44 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseTypeRetrieveResponseTest { + + @Test + fun create() { + val licenseTypeRetrieveResponse = + LicenseTypeRetrieveResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + + assertThat(licenseTypeRetrieveResponse.id()).isEqualTo("id") + assertThat(licenseTypeRetrieveResponse.groupingKey()).isEqualTo("grouping_key") + assertThat(licenseTypeRetrieveResponse.name()).isEqualTo("name") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseTypeRetrieveResponse = + LicenseTypeRetrieveResponse.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + + val roundtrippedLicenseTypeRetrieveResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseTypeRetrieveResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseTypeRetrieveResponse).isEqualTo(licenseTypeRetrieveResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageParamsTest.kt new file mode 100644 index 000000000..d9967a76c --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageParamsTest.kt @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.http.QueryParams +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseUsageGetAllUsageParamsTest { + + @Test + fun create() { + LicenseUsageGetAllUsageParams.builder() + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + } + + @Test + fun queryParams() { + val params = + LicenseUsageGetAllUsageParams.builder() + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("license_type_id", "license_type_id") + .put("subscription_id", "subscription_id") + .put("cursor", "cursor") + .put("end_date", "2019-12-27") + .put("group_by[]", "string") + .put("limit", "1") + .put("start_date", "2019-12-27") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + LicenseUsageGetAllUsageParams.builder() + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("license_type_id", "license_type_id") + .put("subscription_id", "subscription_id") + .build() + ) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageResponseTest.kt new file mode 100644 index 000000000..041366f38 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetAllUsageResponseTest.kt @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseUsageGetAllUsageResponseTest { + + @Test + fun create() { + val licenseUsageGetAllUsageResponse = + LicenseUsageGetAllUsageResponse.builder() + .addData( + LicenseUsageGetAllUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + assertThat(licenseUsageGetAllUsageResponse.data()) + .containsExactly( + LicenseUsageGetAllUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + assertThat(licenseUsageGetAllUsageResponse.paginationMetadata()) + .isEqualTo(PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build()) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseUsageGetAllUsageResponse = + LicenseUsageGetAllUsageResponse.builder() + .addData( + LicenseUsageGetAllUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + val roundtrippedLicenseUsageGetAllUsageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseUsageGetAllUsageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseUsageGetAllUsageResponse) + .isEqualTo(licenseUsageGetAllUsageResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetUsageParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetUsageParamsTest.kt new file mode 100644 index 000000000..b14f6766e --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetUsageParamsTest.kt @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.http.QueryParams +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseUsageGetUsageParamsTest { + + @Test + fun create() { + LicenseUsageGetUsageParams.builder() + .licenseId("license_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + } + + @Test + fun pathParams() { + val params = LicenseUsageGetUsageParams.builder().licenseId("license_id").build() + + assertThat(params._pathParam(0)).isEqualTo("license_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun queryParams() { + val params = + LicenseUsageGetUsageParams.builder() + .licenseId("license_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("cursor", "cursor") + .put("end_date", "2019-12-27") + .put("group_by[]", "string") + .put("limit", "1") + .put("start_date", "2019-12-27") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = LicenseUsageGetUsageParams.builder().licenseId("license_id").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetUsageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetUsageResponseTest.kt new file mode 100644 index 000000000..19893d26e --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/LicenseUsageGetUsageResponseTest.kt @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.jsonMapper +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LicenseUsageGetUsageResponseTest { + + @Test + fun create() { + val licenseUsageGetUsageResponse = + LicenseUsageGetUsageResponse.builder() + .addData( + LicenseUsageGetUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + assertThat(licenseUsageGetUsageResponse.data()) + .containsExactly( + LicenseUsageGetUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + assertThat(licenseUsageGetUsageResponse.paginationMetadata()) + .isEqualTo(PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build()) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val licenseUsageGetUsageResponse = + LicenseUsageGetUsageResponse.builder() + .addData( + LicenseUsageGetUsageResponse.Data.builder() + .allocatedCredits(0.0) + .consumedCredits(0.0) + .endDate(LocalDate.parse("2019-12-27")) + .licenseTypeId("license_type_id") + .pricingUnit("pricing_unit") + .remainingCredits(0.0) + .startDate(LocalDate.parse("2019-12-27")) + .subscriptionId("subscription_id") + .allocationEligibleCredits(0.0) + .externalLicenseId("external_license_id") + .licenseId("license_id") + .sharedPoolCredits(0.0) + .build() + ) + .paginationMetadata( + PaginationMetadata.builder().hasMore(true).nextCursor("next_cursor").build() + ) + .build() + + val roundtrippedLicenseUsageGetUsageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(licenseUsageGetUsageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLicenseUsageGetUsageResponse).isEqualTo(licenseUsageGetUsageResponse) + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListPageResponseTest.kt index 4f47b1738..ab3a67472 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListPageResponseTest.kt @@ -47,6 +47,11 @@ internal class MetricListPageResponseTest { ) .name("name") .status(BillableMetric.Status.ACTIVE) + .addParameterDefinition( + BillableMetric.ParameterDefinition.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .paginationMetadata( @@ -87,6 +92,11 @@ internal class MetricListPageResponseTest { ) .name("name") .status(BillableMetric.Status.ACTIVE) + .addParameterDefinition( + BillableMetric.ParameterDefinition.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) assertThat(metricListPageResponse.paginationMetadata()) @@ -130,6 +140,11 @@ internal class MetricListPageResponseTest { ) .name("name") .status(BillableMetric.Status.ACTIVE) + .addParameterDefinition( + BillableMetric.ParameterDefinition.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .paginationMetadata( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/MutatedSubscriptionTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/MutatedSubscriptionTest.kt index 060ea7c3f..0c63d0bc3 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/MutatedSubscriptionTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/MutatedSubscriptionTest.kt @@ -421,6 +421,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -500,6 +501,13 @@ internal class MutatedSubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -584,6 +592,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -663,10 +672,22 @@ internal class MutatedSubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1000,6 +1021,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1105,6 +1127,13 @@ internal class MutatedSubscriptionTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1521,6 +1550,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1626,6 +1656,13 @@ internal class MutatedSubscriptionTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -2149,6 +2186,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2226,6 +2264,13 @@ internal class MutatedSubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -2305,6 +2350,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2382,10 +2428,22 @@ internal class MutatedSubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) assertThat(mutatedSubscription.redeemedCoupon()) @@ -2704,6 +2762,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2800,6 +2859,13 @@ internal class MutatedSubscriptionTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -3193,6 +3259,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3289,6 +3356,13 @@ internal class MutatedSubscriptionTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -3811,6 +3885,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3890,6 +3965,13 @@ internal class MutatedSubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -3974,6 +4056,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4053,10 +4136,22 @@ internal class MutatedSubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -4390,6 +4485,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4495,6 +4591,13 @@ internal class MutatedSubscriptionTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -4911,6 +5014,7 @@ internal class MutatedSubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5016,6 +5120,13 @@ internal class MutatedSubscriptionTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewAllocationPriceTest.kt index 951ee45e1..9177eefbf 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewAllocationPriceTest.kt @@ -32,6 +32,7 @@ internal class NewAllocationPriceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() @@ -55,6 +56,7 @@ internal class NewAllocationPriceTest { .build() ) assertThat(newAllocationPrice.itemId()).contains("item_id") + assertThat(newAllocationPrice.licenseTypeId()).contains("license_type_id") assertThat(newAllocationPrice.perUnitCostBasis()).contains("per_unit_cost_basis") } @@ -81,6 +83,7 @@ internal class NewAllocationPriceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkPriceTest.kt index 45faf3712..e69f6bbd5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkPriceTest.kt @@ -54,6 +54,7 @@ internal class NewFloatingBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -111,6 +112,7 @@ internal class NewFloatingBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingBulkPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingBulkPrice.metadata()) .contains( NewFloatingBulkPrice.Metadata.builder() @@ -164,6 +166,7 @@ internal class NewFloatingBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPriceTest.kt index 340da8294..950a731be 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingBulkWithProrationPriceTest.kt @@ -63,6 +63,7 @@ internal class NewFloatingBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingBulkWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -135,6 +136,7 @@ internal class NewFloatingBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingBulkWithProrationPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingBulkWithProrationPrice.metadata()) .contains( NewFloatingBulkWithProrationPrice.Metadata.builder() @@ -197,6 +199,7 @@ internal class NewFloatingBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingBulkWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPriceTest.kt index 8952c2abc..95778c09c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingCumulativeGroupedBulkPriceTest.kt @@ -61,6 +61,7 @@ internal class NewFloatingCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingCumulativeGroupedBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -131,6 +132,8 @@ internal class NewFloatingCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingCumulativeGroupedBulkPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingCumulativeGroupedBulkPrice.metadata()) .contains( NewFloatingCumulativeGroupedBulkPrice.Metadata.builder() @@ -191,6 +194,7 @@ internal class NewFloatingCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingCumulativeGroupedBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPriceTest.kt index 094d0a60f..5b424a3f1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedAllocationPriceTest.kt @@ -54,6 +54,7 @@ internal class NewFloatingGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -117,6 +118,7 @@ internal class NewFloatingGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingGroupedAllocationPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingGroupedAllocationPrice.metadata()) .contains( NewFloatingGroupedAllocationPrice.Metadata.builder() @@ -170,6 +172,7 @@ internal class NewFloatingGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePriceTest.kt index 66160bb01..b458fdd74 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPackagePriceTest.kt @@ -67,6 +67,7 @@ internal class NewFloatingGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -143,6 +144,7 @@ internal class NewFloatingGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingGroupedTieredPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingGroupedTieredPackagePrice.metadata()) .contains( NewFloatingGroupedTieredPackagePrice.Metadata.builder() @@ -209,6 +211,7 @@ internal class NewFloatingGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPriceTest.kt index 8676809fb..c7d94a269 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedTieredPriceTest.kt @@ -64,6 +64,7 @@ internal class NewFloatingGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -135,6 +136,7 @@ internal class NewFloatingGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingGroupedTieredPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingGroupedTieredPrice.metadata()) .contains( NewFloatingGroupedTieredPrice.Metadata.builder() @@ -198,6 +200,7 @@ internal class NewFloatingGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPriceTest.kt index c72fd666a..b3e4acb16 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithMeteredMinimumPriceTest.kt @@ -76,6 +76,7 @@ internal class NewFloatingGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedWithMeteredMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -158,6 +159,8 @@ internal class NewFloatingGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingGroupedWithMeteredMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingGroupedWithMeteredMinimumPrice.metadata()) .contains( NewFloatingGroupedWithMeteredMinimumPrice.Metadata.builder() @@ -233,6 +236,7 @@ internal class NewFloatingGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedWithMeteredMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPriceTest.kt index 5c5a996cc..16d466ec6 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingGroupedWithProratedMinimumPriceTest.kt @@ -58,6 +58,7 @@ internal class NewFloatingGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedWithProratedMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -124,6 +125,8 @@ internal class NewFloatingGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingGroupedWithProratedMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingGroupedWithProratedMinimumPrice.metadata()) .contains( NewFloatingGroupedWithProratedMinimumPrice.Metadata.builder() @@ -181,6 +184,7 @@ internal class NewFloatingGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingGroupedWithProratedMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixPriceTest.kt index 3f1972cf2..2796b1325 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixPriceTest.kt @@ -59,6 +59,7 @@ internal class NewFloatingMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMatrixPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -125,6 +126,7 @@ internal class NewFloatingMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingMatrixPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingMatrixPrice.metadata()) .contains( NewFloatingMatrixPrice.Metadata.builder() @@ -183,6 +185,7 @@ internal class NewFloatingMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMatrixPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPriceTest.kt index 0755eeb7a..ba8869d67 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithAllocationPriceTest.kt @@ -60,6 +60,7 @@ internal class NewFloatingMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMatrixWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -129,6 +130,7 @@ internal class NewFloatingMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingMatrixWithAllocationPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingMatrixWithAllocationPrice.metadata()) .contains( NewFloatingMatrixWithAllocationPrice.Metadata.builder() @@ -188,6 +190,7 @@ internal class NewFloatingMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMatrixWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePriceTest.kt index a611895a2..21bc3c988 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMatrixWithDisplayNamePriceTest.kt @@ -61,6 +61,7 @@ internal class NewFloatingMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMatrixWithDisplayNamePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -130,6 +131,8 @@ internal class NewFloatingMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingMatrixWithDisplayNamePrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingMatrixWithDisplayNamePrice.metadata()) .contains( NewFloatingMatrixWithDisplayNamePrice.Metadata.builder() @@ -190,6 +193,7 @@ internal class NewFloatingMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMatrixWithDisplayNamePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePriceTest.kt index 45b67882e..ae963a1bd 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMaxGroupTieredPackagePriceTest.kt @@ -67,6 +67,7 @@ internal class NewFloatingMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMaxGroupTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -143,6 +144,8 @@ internal class NewFloatingMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingMaxGroupTieredPackagePrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingMaxGroupTieredPackagePrice.metadata()) .contains( NewFloatingMaxGroupTieredPackagePrice.Metadata.builder() @@ -209,6 +212,7 @@ internal class NewFloatingMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMaxGroupTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePriceTest.kt index dbd604263..8d249608f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingMinimumCompositePriceTest.kt @@ -53,6 +53,7 @@ internal class NewFloatingMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMinimumCompositePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -114,6 +115,7 @@ internal class NewFloatingMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingMinimumCompositePrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingMinimumCompositePrice.metadata()) .contains( NewFloatingMinimumCompositePrice.Metadata.builder() @@ -166,6 +168,7 @@ internal class NewFloatingMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingMinimumCompositePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackagePriceTest.kt index ed37b52ea..507d11a43 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackagePriceTest.kt @@ -50,6 +50,7 @@ internal class NewFloatingPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -107,6 +108,7 @@ internal class NewFloatingPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingPackagePrice.metadata()) .contains( NewFloatingPackagePrice.Metadata.builder() @@ -156,6 +158,7 @@ internal class NewFloatingPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPriceTest.kt index ead452761..232023769 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingPackageWithAllocationPriceTest.kt @@ -54,6 +54,7 @@ internal class NewFloatingPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingPackageWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -117,6 +118,8 @@ internal class NewFloatingPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingPackageWithAllocationPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingPackageWithAllocationPrice.metadata()) .contains( NewFloatingPackageWithAllocationPrice.Metadata.builder() @@ -170,6 +173,7 @@ internal class NewFloatingPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingPackageWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPriceTest.kt index ff18721f6..379c10ef8 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithTieredPricingPriceTest.kt @@ -86,6 +86,7 @@ internal class NewFloatingScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingScalableMatrixWithTieredPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -186,6 +187,8 @@ internal class NewFloatingScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingScalableMatrixWithTieredPricingPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingScalableMatrixWithTieredPricingPrice.metadata()) .contains( NewFloatingScalableMatrixWithTieredPricingPrice.Metadata.builder() @@ -271,6 +274,7 @@ internal class NewFloatingScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingScalableMatrixWithTieredPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPriceTest.kt index 202827aa1..454becdda 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingScalableMatrixWithUnitPricingPriceTest.kt @@ -70,6 +70,7 @@ internal class NewFloatingScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingScalableMatrixWithUnitPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -150,6 +151,8 @@ internal class NewFloatingScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingScalableMatrixWithUnitPricingPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingScalableMatrixWithUnitPricingPrice.metadata()) .contains( NewFloatingScalableMatrixWithUnitPricingPrice.Metadata.builder() @@ -219,6 +222,7 @@ internal class NewFloatingScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingScalableMatrixWithUnitPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPriceTest.kt index 848114418..e3361e05c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingThresholdTotalAmountPriceTest.kt @@ -68,6 +68,7 @@ internal class NewFloatingThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingThresholdTotalAmountPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -145,6 +146,7 @@ internal class NewFloatingThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingThresholdTotalAmountPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingThresholdTotalAmountPrice.metadata()) .contains( NewFloatingThresholdTotalAmountPrice.Metadata.builder() @@ -212,6 +214,7 @@ internal class NewFloatingThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingThresholdTotalAmountPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackagePriceTest.kt index 9c48a9c9e..da537b91c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackagePriceTest.kt @@ -64,6 +64,7 @@ internal class NewFloatingTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -135,6 +136,7 @@ internal class NewFloatingTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingTieredPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingTieredPackagePrice.metadata()) .contains( NewFloatingTieredPackagePrice.Metadata.builder() @@ -198,6 +200,7 @@ internal class NewFloatingTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPriceTest.kt index 35b3511b3..e371a644a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPackageWithMinimumPriceTest.kt @@ -73,6 +73,7 @@ internal class NewFloatingTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredPackageWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -152,6 +153,8 @@ internal class NewFloatingTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingTieredPackageWithMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newFloatingTieredPackageWithMinimumPrice.metadata()) .contains( NewFloatingTieredPackageWithMinimumPrice.Metadata.builder() @@ -224,6 +227,7 @@ internal class NewFloatingTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredPackageWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPriceTest.kt index 07ac87b3b..310f7efe7 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredPriceTest.kt @@ -59,6 +59,7 @@ internal class NewFloatingTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -125,6 +126,7 @@ internal class NewFloatingTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingTieredPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingTieredPrice.metadata()) .contains( NewFloatingTieredPrice.Metadata.builder() @@ -183,6 +185,7 @@ internal class NewFloatingTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPriceTest.kt index bd4fdacc9..43be9b6d7 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithMinimumPriceTest.kt @@ -67,6 +67,7 @@ internal class NewFloatingTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -143,6 +144,7 @@ internal class NewFloatingTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingTieredWithMinimumPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingTieredWithMinimumPrice.metadata()) .contains( NewFloatingTieredWithMinimumPrice.Metadata.builder() @@ -209,6 +211,7 @@ internal class NewFloatingTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPriceTest.kt index 1769baf18..6a1f6b3e4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingTieredWithProrationPriceTest.kt @@ -58,6 +58,7 @@ internal class NewFloatingTieredWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -124,6 +125,7 @@ internal class NewFloatingTieredWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingTieredWithProrationPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingTieredWithProrationPrice.metadata()) .contains( NewFloatingTieredWithProrationPrice.Metadata.builder() @@ -181,6 +183,7 @@ internal class NewFloatingTieredWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingTieredWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitPriceTest.kt index 65938c6f0..b7d43d65c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitPriceTest.kt @@ -48,6 +48,7 @@ internal class NewFloatingUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -101,6 +102,7 @@ internal class NewFloatingUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingUnitPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingUnitPrice.metadata()) .contains( NewFloatingUnitPrice.Metadata.builder() @@ -148,6 +150,7 @@ internal class NewFloatingUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPriceTest.kt index 081e00644..20731a8e5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithPercentPriceTest.kt @@ -53,6 +53,7 @@ internal class NewFloatingUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitWithPercentPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -114,6 +115,7 @@ internal class NewFloatingUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingUnitWithPercentPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingUnitWithPercentPrice.metadata()) .contains( NewFloatingUnitWithPercentPrice.Metadata.builder() @@ -166,6 +168,7 @@ internal class NewFloatingUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitWithPercentPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPriceTest.kt index 2e4fae2ce..8bf8e24f4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewFloatingUnitWithProrationPriceTest.kt @@ -52,6 +52,7 @@ internal class NewFloatingUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -113,6 +114,7 @@ internal class NewFloatingUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newFloatingUnitWithProrationPrice.licenseTypeId()).contains("license_type_id") assertThat(newFloatingUnitWithProrationPrice.metadata()) .contains( NewFloatingUnitWithProrationPrice.Metadata.builder() @@ -164,6 +166,7 @@ internal class NewFloatingUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkPriceTest.kt index f3f1100a7..f4412d93b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkPriceTest.kt @@ -54,6 +54,7 @@ internal class NewPlanBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -112,6 +113,7 @@ internal class NewPlanBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanBulkPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanBulkPrice.metadata()) .contains( NewPlanBulkPrice.Metadata.builder() @@ -166,6 +168,7 @@ internal class NewPlanBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPriceTest.kt index 93f84aaf9..068932a9b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanBulkWithProrationPriceTest.kt @@ -63,6 +63,7 @@ internal class NewPlanBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanBulkWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -134,6 +135,7 @@ internal class NewPlanBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanBulkWithProrationPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanBulkWithProrationPrice.metadata()) .contains( NewPlanBulkWithProrationPrice.Metadata.builder() @@ -197,6 +199,7 @@ internal class NewPlanBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanBulkWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPriceTest.kt index 20bd1b583..85970e725 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanCumulativeGroupedBulkPriceTest.kt @@ -61,6 +61,7 @@ internal class NewPlanCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanCumulativeGroupedBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -131,6 +132,7 @@ internal class NewPlanCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanCumulativeGroupedBulkPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanCumulativeGroupedBulkPrice.metadata()) .contains( NewPlanCumulativeGroupedBulkPrice.Metadata.builder() @@ -192,6 +194,7 @@ internal class NewPlanCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanCumulativeGroupedBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPriceTest.kt index 5ce0cab0d..058ae49ce 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedAllocationPriceTest.kt @@ -54,6 +54,7 @@ internal class NewPlanGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -116,6 +117,7 @@ internal class NewPlanGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanGroupedAllocationPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanGroupedAllocationPrice.metadata()) .contains( NewPlanGroupedAllocationPrice.Metadata.builder() @@ -170,6 +172,7 @@ internal class NewPlanGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePriceTest.kt index a20e9666f..b126aaae1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPackagePriceTest.kt @@ -67,6 +67,7 @@ internal class NewPlanGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -141,6 +142,7 @@ internal class NewPlanGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanGroupedTieredPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanGroupedTieredPackagePrice.metadata()) .contains( NewPlanGroupedTieredPackagePrice.Metadata.builder() @@ -208,6 +210,7 @@ internal class NewPlanGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPriceTest.kt index b3d3e0785..168d14508 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedTieredPriceTest.kt @@ -64,6 +64,7 @@ internal class NewPlanGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -136,6 +137,7 @@ internal class NewPlanGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanGroupedTieredPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanGroupedTieredPrice.metadata()) .contains( NewPlanGroupedTieredPrice.Metadata.builder() @@ -200,6 +202,7 @@ internal class NewPlanGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPriceTest.kt index f135d9304..149675b40 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithMeteredMinimumPriceTest.kt @@ -73,6 +73,7 @@ internal class NewPlanGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedWithMeteredMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -154,6 +155,8 @@ internal class NewPlanGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanGroupedWithMeteredMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newPlanGroupedWithMeteredMinimumPrice.metadata()) .contains( NewPlanGroupedWithMeteredMinimumPrice.Metadata.builder() @@ -227,6 +230,7 @@ internal class NewPlanGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedWithMeteredMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPriceTest.kt index b237e469b..1557ae707 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanGroupedWithProratedMinimumPriceTest.kt @@ -57,6 +57,7 @@ internal class NewPlanGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedWithProratedMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -123,6 +124,8 @@ internal class NewPlanGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanGroupedWithProratedMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newPlanGroupedWithProratedMinimumPrice.metadata()) .contains( NewPlanGroupedWithProratedMinimumPrice.Metadata.builder() @@ -180,6 +183,7 @@ internal class NewPlanGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanGroupedWithProratedMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixPriceTest.kt index 789bb03b5..aba350850 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixPriceTest.kt @@ -59,6 +59,7 @@ internal class NewPlanMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMatrixPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -124,6 +125,7 @@ internal class NewPlanMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanMatrixPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanMatrixPrice.metadata()) .contains( NewPlanMatrixPrice.Metadata.builder() @@ -183,6 +185,7 @@ internal class NewPlanMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMatrixPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPriceTest.kt index 53233108d..ff7218f4b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithAllocationPriceTest.kt @@ -60,6 +60,7 @@ internal class NewPlanMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMatrixWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -129,6 +130,7 @@ internal class NewPlanMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanMatrixWithAllocationPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanMatrixWithAllocationPrice.metadata()) .contains( NewPlanMatrixWithAllocationPrice.Metadata.builder() @@ -189,6 +191,7 @@ internal class NewPlanMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMatrixWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePriceTest.kt index 1b1327df7..ea02b00e0 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMatrixWithDisplayNamePriceTest.kt @@ -60,6 +60,7 @@ internal class NewPlanMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMatrixWithDisplayNamePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -130,6 +131,7 @@ internal class NewPlanMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanMatrixWithDisplayNamePrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanMatrixWithDisplayNamePrice.metadata()) .contains( NewPlanMatrixWithDisplayNamePrice.Metadata.builder() @@ -190,6 +192,7 @@ internal class NewPlanMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMatrixWithDisplayNamePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePriceTest.kt index 4d3661632..d4806a69e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMaxGroupTieredPackagePriceTest.kt @@ -67,6 +67,7 @@ internal class NewPlanMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMaxGroupTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -142,6 +143,7 @@ internal class NewPlanMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanMaxGroupTieredPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanMaxGroupTieredPackagePrice.metadata()) .contains( NewPlanMaxGroupTieredPackagePrice.Metadata.builder() @@ -209,6 +211,7 @@ internal class NewPlanMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMaxGroupTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMinimumCompositePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMinimumCompositePriceTest.kt index d35d849ad..70e8a8285 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMinimumCompositePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanMinimumCompositePriceTest.kt @@ -53,6 +53,7 @@ internal class NewPlanMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMinimumCompositePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -114,6 +115,7 @@ internal class NewPlanMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanMinimumCompositePrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanMinimumCompositePrice.metadata()) .contains( NewPlanMinimumCompositePrice.Metadata.builder() @@ -167,6 +169,7 @@ internal class NewPlanMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanMinimumCompositePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackagePriceTest.kt index 2b8f8db8b..9ed1c967c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackagePriceTest.kt @@ -50,6 +50,7 @@ internal class NewPlanPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -106,6 +107,7 @@ internal class NewPlanPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanPackagePrice.metadata()) .contains( NewPlanPackagePrice.Metadata.builder() @@ -156,6 +158,7 @@ internal class NewPlanPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPriceTest.kt index 06963f176..24eb1816b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanPackageWithAllocationPriceTest.kt @@ -54,6 +54,7 @@ internal class NewPlanPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanPackageWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -118,6 +119,7 @@ internal class NewPlanPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanPackageWithAllocationPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanPackageWithAllocationPrice.metadata()) .contains( NewPlanPackageWithAllocationPrice.Metadata.builder() @@ -172,6 +174,7 @@ internal class NewPlanPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanPackageWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPriceTest.kt index 613d5e6f1..9e0c45e2d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithTieredPricingPriceTest.kt @@ -86,6 +86,7 @@ internal class NewPlanScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanScalableMatrixWithTieredPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -183,6 +184,8 @@ internal class NewPlanScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanScalableMatrixWithTieredPricingPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newPlanScalableMatrixWithTieredPricingPrice.metadata()) .contains( NewPlanScalableMatrixWithTieredPricingPrice.Metadata.builder() @@ -270,6 +273,7 @@ internal class NewPlanScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanScalableMatrixWithTieredPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPriceTest.kt index 83a3eb800..c5bdc45ef 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanScalableMatrixWithUnitPricingPriceTest.kt @@ -69,6 +69,7 @@ internal class NewPlanScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanScalableMatrixWithUnitPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -148,6 +149,8 @@ internal class NewPlanScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanScalableMatrixWithUnitPricingPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newPlanScalableMatrixWithUnitPricingPrice.metadata()) .contains( NewPlanScalableMatrixWithUnitPricingPrice.Metadata.builder() @@ -217,6 +220,7 @@ internal class NewPlanScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanScalableMatrixWithUnitPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPriceTest.kt index 90357304e..47c496502 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanThresholdTotalAmountPriceTest.kt @@ -68,6 +68,7 @@ internal class NewPlanThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanThresholdTotalAmountPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -143,6 +144,7 @@ internal class NewPlanThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanThresholdTotalAmountPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanThresholdTotalAmountPrice.metadata()) .contains( NewPlanThresholdTotalAmountPrice.Metadata.builder() @@ -211,6 +213,7 @@ internal class NewPlanThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanThresholdTotalAmountPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackagePriceTest.kt index 35759c36d..e531bd65e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackagePriceTest.kt @@ -64,6 +64,7 @@ internal class NewPlanTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -136,6 +137,7 @@ internal class NewPlanTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanTieredPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanTieredPackagePrice.metadata()) .contains( NewPlanTieredPackagePrice.Metadata.builder() @@ -200,6 +202,7 @@ internal class NewPlanTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPriceTest.kt index 7fad794b9..a5cb898d1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPackageWithMinimumPriceTest.kt @@ -70,6 +70,7 @@ internal class NewPlanTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredPackageWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -148,6 +149,7 @@ internal class NewPlanTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanTieredPackageWithMinimumPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanTieredPackageWithMinimumPrice.metadata()) .contains( NewPlanTieredPackageWithMinimumPrice.Metadata.builder() @@ -218,6 +220,7 @@ internal class NewPlanTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredPackageWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPriceTest.kt index 5176465f5..f220a5660 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredPriceTest.kt @@ -59,6 +59,7 @@ internal class NewPlanTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -124,6 +125,7 @@ internal class NewPlanTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanTieredPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanTieredPrice.metadata()) .contains( NewPlanTieredPrice.Metadata.builder() @@ -183,6 +185,7 @@ internal class NewPlanTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPriceTest.kt index 9cae1ad69..79e3574ed 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanTieredWithMinimumPriceTest.kt @@ -67,6 +67,7 @@ internal class NewPlanTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -142,6 +143,7 @@ internal class NewPlanTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanTieredWithMinimumPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanTieredWithMinimumPrice.metadata()) .contains( NewPlanTieredWithMinimumPrice.Metadata.builder() @@ -209,6 +211,7 @@ internal class NewPlanTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanTieredWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitPriceTest.kt index e3a650dc8..59beb2607 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitPriceTest.kt @@ -48,6 +48,7 @@ internal class NewPlanUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -102,6 +103,7 @@ internal class NewPlanUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanUnitPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanUnitPrice.metadata()) .contains( NewPlanUnitPrice.Metadata.builder() @@ -150,6 +152,7 @@ internal class NewPlanUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPriceTest.kt index 0b4d1f7b0..c6bd0c867 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithPercentPriceTest.kt @@ -53,6 +53,7 @@ internal class NewPlanUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitWithPercentPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -114,6 +115,7 @@ internal class NewPlanUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanUnitWithPercentPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanUnitWithPercentPrice.metadata()) .contains( NewPlanUnitWithPercentPrice.Metadata.builder() @@ -167,6 +169,7 @@ internal class NewPlanUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitWithPercentPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPriceTest.kt index 0325b3841..dfa16f991 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewPlanUnitWithProrationPriceTest.kt @@ -52,6 +52,7 @@ internal class NewPlanUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -112,6 +113,7 @@ internal class NewPlanUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newPlanUnitWithProrationPrice.licenseTypeId()).contains("license_type_id") assertThat(newPlanUnitWithProrationPrice.metadata()) .contains( NewPlanUnitWithProrationPrice.Metadata.builder() @@ -164,6 +166,7 @@ internal class NewPlanUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkPriceTest.kt index 6dded0f58..94d6cf4f7 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkPriceTest.kt @@ -54,6 +54,7 @@ internal class NewSubscriptionBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -114,6 +115,7 @@ internal class NewSubscriptionBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionBulkPrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionBulkPrice.metadata()) .contains( NewSubscriptionBulkPrice.Metadata.builder() @@ -168,6 +170,7 @@ internal class NewSubscriptionBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPriceTest.kt index 86c0346bf..9fcd36023 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionBulkWithProrationPriceTest.kt @@ -65,6 +65,7 @@ internal class NewSubscriptionBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionBulkWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -138,6 +139,8 @@ internal class NewSubscriptionBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionBulkWithProrationPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionBulkWithProrationPrice.metadata()) .contains( NewSubscriptionBulkWithProrationPrice.Metadata.builder() @@ -203,6 +206,7 @@ internal class NewSubscriptionBulkWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionBulkWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPriceTest.kt index d04f7ee3d..00bbe9835 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionCumulativeGroupedBulkPriceTest.kt @@ -63,6 +63,7 @@ internal class NewSubscriptionCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionCumulativeGroupedBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -134,6 +135,8 @@ internal class NewSubscriptionCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionCumulativeGroupedBulkPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionCumulativeGroupedBulkPrice.metadata()) .contains( NewSubscriptionCumulativeGroupedBulkPrice.Metadata.builder() @@ -197,6 +200,7 @@ internal class NewSubscriptionCumulativeGroupedBulkPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionCumulativeGroupedBulkPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPriceTest.kt index 2bad026b8..3a8de1294 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedAllocationPriceTest.kt @@ -54,6 +54,7 @@ internal class NewSubscriptionGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -118,6 +119,8 @@ internal class NewSubscriptionGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionGroupedAllocationPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionGroupedAllocationPrice.metadata()) .contains( NewSubscriptionGroupedAllocationPrice.Metadata.builder() @@ -172,6 +175,7 @@ internal class NewSubscriptionGroupedAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePriceTest.kt index 35e111782..a7b756233 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPackagePriceTest.kt @@ -69,6 +69,7 @@ internal class NewSubscriptionGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -146,6 +147,8 @@ internal class NewSubscriptionGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionGroupedTieredPackagePrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionGroupedTieredPackagePrice.metadata()) .contains( NewSubscriptionGroupedTieredPackagePrice.Metadata.builder() @@ -215,6 +218,7 @@ internal class NewSubscriptionGroupedTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPriceTest.kt index d74b508a1..7f649a4d4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedTieredPriceTest.kt @@ -64,6 +64,7 @@ internal class NewSubscriptionGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -138,6 +139,7 @@ internal class NewSubscriptionGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionGroupedTieredPrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionGroupedTieredPrice.metadata()) .contains( NewSubscriptionGroupedTieredPrice.Metadata.builder() @@ -202,6 +204,7 @@ internal class NewSubscriptionGroupedTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPriceTest.kt index 122ebb77b..f1aef9d49 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithMeteredMinimumPriceTest.kt @@ -77,6 +77,7 @@ internal class NewSubscriptionGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedWithMeteredMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -163,6 +164,8 @@ internal class NewSubscriptionGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionGroupedWithMeteredMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionGroupedWithMeteredMinimumPrice.metadata()) .contains( NewSubscriptionGroupedWithMeteredMinimumPrice.Metadata.builder() @@ -241,6 +244,7 @@ internal class NewSubscriptionGroupedWithMeteredMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedWithMeteredMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPriceTest.kt index f82dd1066..64476d695 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionGroupedWithProratedMinimumPriceTest.kt @@ -58,6 +58,7 @@ internal class NewSubscriptionGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedWithProratedMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -130,6 +131,8 @@ internal class NewSubscriptionGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionGroupedWithProratedMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionGroupedWithProratedMinimumPrice.metadata()) .contains( NewSubscriptionGroupedWithProratedMinimumPrice.Metadata.builder() @@ -189,6 +192,7 @@ internal class NewSubscriptionGroupedWithProratedMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionGroupedWithProratedMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixPriceTest.kt index 2c6dac335..5297a855d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixPriceTest.kt @@ -59,6 +59,7 @@ internal class NewSubscriptionMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMatrixPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -126,6 +127,7 @@ internal class NewSubscriptionMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionMatrixPrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionMatrixPrice.metadata()) .contains( NewSubscriptionMatrixPrice.Metadata.builder() @@ -185,6 +187,7 @@ internal class NewSubscriptionMatrixPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMatrixPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPriceTest.kt index 5ac3dfef8..1d8c78066 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithAllocationPriceTest.kt @@ -62,6 +62,7 @@ internal class NewSubscriptionMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMatrixWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -132,6 +133,8 @@ internal class NewSubscriptionMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionMatrixWithAllocationPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionMatrixWithAllocationPrice.metadata()) .contains( NewSubscriptionMatrixWithAllocationPrice.Metadata.builder() @@ -194,6 +197,7 @@ internal class NewSubscriptionMatrixWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMatrixWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePriceTest.kt index 6ed09c6ac..b21dbdf5b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMatrixWithDisplayNamePriceTest.kt @@ -63,6 +63,7 @@ internal class NewSubscriptionMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMatrixWithDisplayNamePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -134,6 +135,8 @@ internal class NewSubscriptionMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionMatrixWithDisplayNamePrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionMatrixWithDisplayNamePrice.metadata()) .contains( NewSubscriptionMatrixWithDisplayNamePrice.Metadata.builder() @@ -197,6 +200,7 @@ internal class NewSubscriptionMatrixWithDisplayNamePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMatrixWithDisplayNamePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePriceTest.kt index 4ebf6136c..c1ac1e30b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMaxGroupTieredPackagePriceTest.kt @@ -71,6 +71,7 @@ internal class NewSubscriptionMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMaxGroupTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -148,6 +149,8 @@ internal class NewSubscriptionMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionMaxGroupTieredPackagePrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionMaxGroupTieredPackagePrice.metadata()) .contains( NewSubscriptionMaxGroupTieredPackagePrice.Metadata.builder() @@ -219,6 +222,7 @@ internal class NewSubscriptionMaxGroupTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMaxGroupTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePriceTest.kt index 19dedc47c..8bfeabc78 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionMinimumCompositePriceTest.kt @@ -53,6 +53,7 @@ internal class NewSubscriptionMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMinimumCompositePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -116,6 +117,7 @@ internal class NewSubscriptionMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionMinimumCompositePrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionMinimumCompositePrice.metadata()) .contains( NewSubscriptionMinimumCompositePrice.Metadata.builder() @@ -169,6 +171,7 @@ internal class NewSubscriptionMinimumCompositePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionMinimumCompositePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackagePriceTest.kt index 169262636..291135cba 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackagePriceTest.kt @@ -50,6 +50,7 @@ internal class NewSubscriptionPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -108,6 +109,7 @@ internal class NewSubscriptionPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionPackagePrice.metadata()) .contains( NewSubscriptionPackagePrice.Metadata.builder() @@ -158,6 +160,7 @@ internal class NewSubscriptionPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPriceTest.kt index 0a6d6087b..3b813e67b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionPackageWithAllocationPriceTest.kt @@ -56,6 +56,7 @@ internal class NewSubscriptionPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionPackageWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -120,6 +121,8 @@ internal class NewSubscriptionPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionPackageWithAllocationPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionPackageWithAllocationPrice.metadata()) .contains( NewSubscriptionPackageWithAllocationPrice.Metadata.builder() @@ -176,6 +179,7 @@ internal class NewSubscriptionPackageWithAllocationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionPackageWithAllocationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPriceTest.kt index ddc357025..fedd9901e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithTieredPricingPriceTest.kt @@ -86,6 +86,7 @@ internal class NewSubscriptionScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionScalableMatrixWithTieredPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -196,6 +197,8 @@ internal class NewSubscriptionScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionScalableMatrixWithTieredPricingPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionScalableMatrixWithTieredPricingPrice.metadata()) .contains( NewSubscriptionScalableMatrixWithTieredPricingPrice.Metadata.builder() @@ -283,6 +286,7 @@ internal class NewSubscriptionScalableMatrixWithTieredPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionScalableMatrixWithTieredPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPriceTest.kt index 312ab4b27..fd4dc6d0b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionScalableMatrixWithUnitPricingPriceTest.kt @@ -70,6 +70,7 @@ internal class NewSubscriptionScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionScalableMatrixWithUnitPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -159,6 +160,8 @@ internal class NewSubscriptionScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionScalableMatrixWithUnitPricingPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionScalableMatrixWithUnitPricingPrice.metadata()) .contains( NewSubscriptionScalableMatrixWithUnitPricingPrice.Metadata.builder() @@ -230,6 +233,7 @@ internal class NewSubscriptionScalableMatrixWithUnitPricingPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionScalableMatrixWithUnitPricingPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPriceTest.kt index d002d94c0..9198891c6 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionThresholdTotalAmountPriceTest.kt @@ -70,6 +70,7 @@ internal class NewSubscriptionThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionThresholdTotalAmountPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -148,6 +149,8 @@ internal class NewSubscriptionThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionThresholdTotalAmountPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionThresholdTotalAmountPrice.metadata()) .contains( NewSubscriptionThresholdTotalAmountPrice.Metadata.builder() @@ -218,6 +221,7 @@ internal class NewSubscriptionThresholdTotalAmountPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionThresholdTotalAmountPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePriceTest.kt index 0357b6191..c523914c8 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackagePriceTest.kt @@ -64,6 +64,7 @@ internal class NewSubscriptionTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -138,6 +139,7 @@ internal class NewSubscriptionTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionTieredPackagePrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionTieredPackagePrice.metadata()) .contains( NewSubscriptionTieredPackagePrice.Metadata.builder() @@ -202,6 +204,7 @@ internal class NewSubscriptionTieredPackagePriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredPackagePrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPriceTest.kt index 110d066f6..c9dc66e10 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPackageWithMinimumPriceTest.kt @@ -76,6 +76,7 @@ internal class NewSubscriptionTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredPackageWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -159,6 +160,8 @@ internal class NewSubscriptionTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionTieredPackageWithMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionTieredPackageWithMinimumPrice.metadata()) .contains( NewSubscriptionTieredPackageWithMinimumPrice.Metadata.builder() @@ -236,6 +239,7 @@ internal class NewSubscriptionTieredPackageWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredPackageWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPriceTest.kt index 5260ed9e8..f387450e8 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredPriceTest.kt @@ -59,6 +59,7 @@ internal class NewSubscriptionTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -126,6 +127,7 @@ internal class NewSubscriptionTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionTieredPrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionTieredPrice.metadata()) .contains( NewSubscriptionTieredPrice.Metadata.builder() @@ -185,6 +187,7 @@ internal class NewSubscriptionTieredPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPriceTest.kt index 822033076..cdfe808c6 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionTieredWithMinimumPriceTest.kt @@ -69,6 +69,7 @@ internal class NewSubscriptionTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -146,6 +147,8 @@ internal class NewSubscriptionTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionTieredWithMinimumPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionTieredWithMinimumPrice.metadata()) .contains( NewSubscriptionTieredWithMinimumPrice.Metadata.builder() @@ -215,6 +218,7 @@ internal class NewSubscriptionTieredWithMinimumPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionTieredWithMinimumPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitPriceTest.kt index d9a6fe54d..39d8a9449 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitPriceTest.kt @@ -48,6 +48,7 @@ internal class NewSubscriptionUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -104,6 +105,7 @@ internal class NewSubscriptionUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionUnitPrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionUnitPrice.metadata()) .contains( NewSubscriptionUnitPrice.Metadata.builder() @@ -152,6 +154,7 @@ internal class NewSubscriptionUnitPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPriceTest.kt index dee30f504..20dc58ccf 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithPercentPriceTest.kt @@ -53,6 +53,7 @@ internal class NewSubscriptionUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitWithPercentPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -116,6 +117,7 @@ internal class NewSubscriptionUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionUnitWithPercentPrice.licenseTypeId()).contains("license_type_id") assertThat(newSubscriptionUnitWithPercentPrice.metadata()) .contains( NewSubscriptionUnitWithPercentPrice.Metadata.builder() @@ -169,6 +171,7 @@ internal class NewSubscriptionUnitWithPercentPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitWithPercentPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPriceTest.kt index 9dd1ce78d..1d19980ea 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/NewSubscriptionUnitWithProrationPriceTest.kt @@ -52,6 +52,7 @@ internal class NewSubscriptionUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -114,6 +115,8 @@ internal class NewSubscriptionUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + assertThat(newSubscriptionUnitWithProrationPrice.licenseTypeId()) + .contains("license_type_id") assertThat(newSubscriptionUnitWithProrationPrice.metadata()) .contains( NewSubscriptionUnitWithProrationPrice.Metadata.builder() @@ -166,6 +169,7 @@ internal class NewSubscriptionUnitWithProrationPriceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitWithProrationPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PerPriceCostTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PerPriceCostTest.kt index 210a3f813..25066561a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PerPriceCostTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PerPriceCostTest.kt @@ -56,6 +56,7 @@ internal class PerPriceCostTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -130,6 +131,13 @@ internal class PerPriceCostTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -181,6 +189,7 @@ internal class PerPriceCostTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -255,6 +264,13 @@ internal class PerPriceCostTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) ) @@ -310,6 +326,7 @@ internal class PerPriceCostTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -384,6 +401,13 @@ internal class PerPriceCostTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") 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 c4bbae5ee..843dddb65 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 @@ -36,6 +36,7 @@ internal class PlanCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -83,6 +84,7 @@ internal class PlanCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -169,6 +171,7 @@ internal class PlanCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -218,6 +221,7 @@ internal class PlanCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -302,6 +306,7 @@ internal class PlanCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -349,6 +354,7 @@ internal class PlanCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListPageResponseTest.kt index f88092a24..749c61a5f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListPageResponseTest.kt @@ -210,6 +210,7 @@ internal class PlanListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -289,6 +290,13 @@ internal class PlanListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -502,6 +510,7 @@ internal class PlanListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -579,6 +588,13 @@ internal class PlanListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -802,6 +818,7 @@ internal class PlanListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -881,6 +898,13 @@ internal class PlanListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( 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 851d4c480..36dc533e7 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 @@ -198,6 +198,7 @@ internal class PlanTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -272,6 +273,13 @@ internal class PlanTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -486,6 +494,7 @@ internal class PlanTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -560,6 +569,13 @@ internal class PlanTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) ) @@ -769,6 +785,7 @@ internal class PlanTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -843,6 +860,13 @@ internal class PlanTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanVersionTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanVersionTest.kt index be7ed5eff..98a4f5fc5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanVersionTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanVersionTest.kt @@ -89,6 +89,7 @@ internal class PlanVersionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -163,6 +164,13 @@ internal class PlanVersionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .version(0L) @@ -248,6 +256,7 @@ internal class PlanVersionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -322,6 +331,13 @@ internal class PlanVersionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) ) @@ -406,6 +422,7 @@ internal class PlanVersionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -480,6 +497,13 @@ internal class PlanVersionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .version(0L) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceCreateParamsTest.kt index 4f4e9b97c..21470db42 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceCreateParamsTest.kt @@ -49,6 +49,7 @@ internal class PriceCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -103,6 +104,7 @@ internal class PriceCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -156,6 +158,7 @@ internal class PriceCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateMultipleParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateMultipleParamsTest.kt index eb10246d1..148355434 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateMultipleParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateMultipleParamsTest.kt @@ -22,6 +22,12 @@ internal class PriceEvaluateMultipleParamsTest { .externalPriceId("external_price_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateMultipleParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -65,6 +71,7 @@ internal class PriceEvaluateMultipleParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -91,6 +98,12 @@ internal class PriceEvaluateMultipleParamsTest { .externalPriceId("external_price_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateMultipleParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -136,6 +149,7 @@ internal class PriceEvaluateMultipleParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -161,6 +175,12 @@ internal class PriceEvaluateMultipleParamsTest { .externalPriceId("external_price_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateMultipleParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -204,6 +224,7 @@ internal class PriceEvaluateMultipleParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) 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 c017f5856..e41ef0c44 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 @@ -2,6 +2,7 @@ package com.withorb.api.models +import com.withorb.api.core.JsonValue import java.time.OffsetDateTime import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat @@ -19,6 +20,11 @@ internal class PriceEvaluateParamsTest { .externalCustomerId("external_customer_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateParams.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() } @@ -47,6 +53,11 @@ internal class PriceEvaluateParamsTest { .externalCustomerId("external_customer_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateParams.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() val body = params._body() @@ -60,6 +71,12 @@ internal class PriceEvaluateParamsTest { .contains("my_numeric_property > 100 AND my_other_property = 'bar'") assertThat(body.groupingKeys().getOrNull()) .containsExactly("case when my_event_type = 'foo' then true else false end") + assertThat(body.metricParameterOverrides()) + .contains( + PriceEvaluateParams.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParamsTest.kt index 40a74d21f..9133061a5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluatePreviewEventsParamsTest.kt @@ -35,6 +35,12 @@ internal class PriceEvaluatePreviewEventsParamsTest { .externalPriceId("external_price_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluatePreviewEventsParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -78,6 +84,7 @@ internal class PriceEvaluatePreviewEventsParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -117,6 +124,13 @@ internal class PriceEvaluatePreviewEventsParamsTest { .externalPriceId("external_price_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluatePreviewEventsParams.PriceEvaluation + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -162,6 +176,7 @@ internal class PriceEvaluatePreviewEventsParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -201,6 +216,12 @@ internal class PriceEvaluatePreviewEventsParamsTest { .externalPriceId("external_price_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluatePreviewEventsParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -244,6 +265,7 @@ internal class PriceEvaluatePreviewEventsParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceIntervalTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceIntervalTest.kt index 91f34c657..a1556ff9e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceIntervalTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceIntervalTest.kt @@ -71,6 +71,7 @@ internal class PriceIntervalTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -145,10 +146,22 @@ internal class PriceIntervalTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() assertThat(priceInterval.id()).isEqualTo("id") @@ -212,6 +225,7 @@ internal class PriceIntervalTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -286,12 +300,25 @@ internal class PriceIntervalTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) ) assertThat(priceInterval.startDate()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(priceInterval.usageCustomerIds().getOrNull()).containsExactly("string") + assertThat(priceInterval.metricParameterOverrides()) + .contains( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) } @Test @@ -354,6 +381,7 @@ internal class PriceIntervalTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -428,10 +456,22 @@ internal class PriceIntervalTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() val roundtrippedPriceInterval = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListPageResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListPageResponseTest.kt index adcd2fae7..65d4d7789 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListPageResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListPageResponseTest.kt @@ -56,6 +56,7 @@ internal class PriceListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -130,6 +131,13 @@ internal class PriceListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .paginationMetadata( @@ -180,6 +188,7 @@ internal class PriceListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -254,6 +263,13 @@ internal class PriceListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) ) @@ -307,6 +323,7 @@ internal class PriceListPageResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -381,6 +398,13 @@ internal class PriceListPageResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .paginationMetadata( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceTest.kt index 158dacf8c..2642c354b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceTest.kt @@ -58,6 +58,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -130,6 +131,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofUnit(unit) @@ -212,6 +220,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -286,6 +295,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -338,6 +354,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -421,6 +438,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Tiered.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofTiered(tiered) @@ -503,6 +527,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -586,6 +611,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Tiered.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -645,6 +677,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -716,6 +749,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Bulk.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofBulk(bulk) @@ -808,6 +848,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -879,6 +920,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Bulk.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -953,6 +1001,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1024,6 +1073,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.BulkWithFilters.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofBulkWithFilters(bulkWithFilters) @@ -1128,6 +1184,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1199,6 +1256,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.BulkWithFilters.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -1251,6 +1315,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1325,6 +1390,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Package.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofPackage(package_) @@ -1407,6 +1479,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1484,6 +1557,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Package.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -1536,6 +1616,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1619,6 +1700,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Matrix.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofMatrix(matrix) @@ -1701,6 +1789,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1784,6 +1873,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Matrix.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -1836,6 +1932,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1926,6 +2023,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.ThresholdTotalAmount.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofThresholdTotalAmount(thresholdTotalAmount) @@ -2010,6 +2114,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2102,6 +2207,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.ThresholdTotalAmount.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -2154,6 +2266,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2242,6 +2355,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredPackage.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofTieredPackage(tieredPackage) @@ -2324,6 +2444,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2412,6 +2533,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredPackage.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -2464,6 +2592,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2555,6 +2684,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredWithMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofTieredWithMinimum(tieredWithMinimum) @@ -2639,6 +2775,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2730,6 +2867,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredWithMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -2782,6 +2926,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2870,6 +3015,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedTiered.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofGroupedTiered(groupedTiered) @@ -2952,6 +3104,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3040,6 +3193,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedTiered.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -3094,6 +3254,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3186,6 +3347,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredPackageWithMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofTieredPackageWithMinimum(tieredPackageWithMinimum) @@ -3273,6 +3441,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3365,6 +3534,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredPackageWithMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -3419,6 +3595,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3497,6 +3674,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.PackageWithAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofPackageWithAllocation(packageWithAllocation) @@ -3581,6 +3765,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3659,6 +3844,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.PackageWithAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -3711,6 +3903,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3788,6 +3981,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitWithPercent.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofUnitWithPercent(unitWithPercent) @@ -3870,6 +4070,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3947,6 +4148,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitWithPercent.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -3999,6 +4207,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4083,6 +4292,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MatrixWithAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofMatrixWithAllocation(matrixWithAllocation) @@ -4167,6 +4383,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4251,6 +4468,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MatrixWithAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -4303,6 +4527,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4384,6 +4609,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredWithProration.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofTieredWithProration(tieredWithProration) @@ -4468,6 +4700,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4549,6 +4782,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.TieredWithProration.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -4601,6 +4841,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4677,6 +4918,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitWithProration.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofUnitWithProration(unitWithProration) @@ -4761,6 +5009,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4837,6 +5086,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitWithProration.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -4889,6 +5145,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4967,6 +5224,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofGroupedAllocation(groupedAllocation) @@ -5051,6 +5315,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5129,6 +5394,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -5197,6 +5469,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5268,6 +5541,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.BulkWithProration.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofBulkWithProration(bulkWithProration) @@ -5368,6 +5648,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5439,6 +5720,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.BulkWithProration.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -5493,6 +5781,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5571,6 +5860,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedWithProratedMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofGroupedWithProratedMinimum(groupedWithProratedMinimum) @@ -5658,6 +5954,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5736,6 +6033,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedWithProratedMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -5790,6 +6094,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5885,6 +6190,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedWithMeteredMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofGroupedWithMeteredMinimum(groupedWithMeteredMinimum) @@ -5972,6 +6284,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6067,6 +6380,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedWithMeteredMinimum.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -6123,6 +6443,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6202,6 +6523,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedWithMinMaxThresholds.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds) @@ -6290,6 +6618,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6370,6 +6699,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedWithMinMaxThresholds.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -6424,6 +6760,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6508,6 +6845,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MatrixWithDisplayName.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofMatrixWithDisplayName(matrixWithDisplayName) @@ -6592,6 +6936,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6676,6 +7021,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MatrixWithDisplayName.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -6728,6 +7080,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6817,6 +7170,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedTieredPackage.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofGroupedTieredPackage(groupedTieredPackage) @@ -6901,6 +7261,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -6990,6 +7351,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.GroupedTieredPackage.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -7044,6 +7412,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -7133,6 +7502,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MaxGroupTieredPackage.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofMaxGroupTieredPackage(maxGroupTieredPackage) @@ -7217,6 +7593,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -7308,6 +7685,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MaxGroupTieredPackage.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -7365,6 +7749,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -7454,6 +7839,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.ScalableMatrixWithUnitPricing.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing) @@ -7542,6 +7934,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -7632,6 +8025,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.ScalableMatrixWithUnitPricing.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -7690,6 +8090,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -7796,6 +8197,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.ScalableMatrixWithTieredPricing.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing) @@ -7885,6 +8293,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -7991,6 +8400,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.ScalableMatrixWithTieredPricing.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -8045,6 +8461,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .cumulativeGroupedBulkConfig( @@ -8129,6 +8546,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.CumulativeGroupedBulk.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk) @@ -8213,6 +8637,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .cumulativeGroupedBulkConfig( @@ -8298,6 +8723,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.CumulativeGroupedBulk.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -8354,6 +8786,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .cumulativeGroupedAllocationConfig( @@ -8433,6 +8866,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.CumulativeGroupedAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofCumulativeGroupedAllocation(cumulativeGroupedAllocation) @@ -8521,6 +8961,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .cumulativeGroupedAllocationConfig( @@ -8601,6 +9042,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.CumulativeGroupedAllocation.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -8653,6 +9101,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -8730,6 +9179,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MinimumComposite.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofMinimumComposite(minimumComposite) @@ -8812,6 +9268,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -8889,6 +9346,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.MinimumComposite.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -8941,6 +9405,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -9013,6 +9478,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Percent.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofPercent(percent) @@ -9095,6 +9567,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -9167,6 +9640,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.Percent.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) @@ -9219,6 +9699,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -9297,6 +9778,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.EventOutput.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() val price = Price.ofEventOutput(eventOutput) @@ -9379,6 +9867,7 @@ internal class PriceTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -9457,6 +9946,13 @@ internal class PriceTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.EventOutput.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponseTest.kt index 0f2cac109..5a07ae864 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponseTest.kt @@ -461,6 +461,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -552,6 +553,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -650,6 +658,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -741,10 +750,22 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1132,6 +1153,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1255,6 +1277,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1746,6 +1775,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1869,6 +1899,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -2438,6 +2475,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2521,6 +2559,13 @@ internal class SubscriptionChangeApplyResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -2610,6 +2655,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2693,10 +2739,22 @@ internal class SubscriptionChangeApplyResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -3056,6 +3114,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3172,6 +3231,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -3625,6 +3691,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3741,6 +3808,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -4329,6 +4403,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4420,6 +4495,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -4518,6 +4600,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4609,10 +4692,22 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -5000,6 +5095,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5123,6 +5219,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -5614,6 +5717,7 @@ internal class SubscriptionChangeApplyResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5737,6 +5841,13 @@ internal class SubscriptionChangeApplyResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeCancelResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeCancelResponseTest.kt index f495f5643..3ba7045a1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeCancelResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeCancelResponseTest.kt @@ -461,6 +461,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -552,6 +553,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -650,6 +658,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -741,10 +750,22 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1132,6 +1153,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1255,6 +1277,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1746,6 +1775,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1869,6 +1899,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -2438,6 +2475,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2521,6 +2559,13 @@ internal class SubscriptionChangeCancelResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -2610,6 +2655,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2693,10 +2739,22 @@ internal class SubscriptionChangeCancelResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -3056,6 +3114,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3172,6 +3231,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -3625,6 +3691,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3741,6 +3808,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -4329,6 +4403,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4420,6 +4495,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -4518,6 +4600,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4609,10 +4692,22 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -5000,6 +5095,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5123,6 +5219,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -5614,6 +5717,7 @@ internal class SubscriptionChangeCancelResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5737,6 +5841,13 @@ internal class SubscriptionChangeCancelResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeRetrieveResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeRetrieveResponseTest.kt index 5254d6977..599ac44e7 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeRetrieveResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionChangeRetrieveResponseTest.kt @@ -461,6 +461,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -552,6 +553,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -650,6 +658,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -741,10 +750,22 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1132,6 +1153,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1255,6 +1277,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -1746,6 +1775,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1869,6 +1899,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -2438,6 +2475,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2521,6 +2559,13 @@ internal class SubscriptionChangeRetrieveResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -2610,6 +2655,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2693,10 +2739,22 @@ internal class SubscriptionChangeRetrieveResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -3056,6 +3114,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3172,6 +3231,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -3625,6 +3691,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -3741,6 +3808,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -4329,6 +4403,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4420,6 +4495,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -4518,6 +4600,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -4609,10 +4692,22 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -5000,6 +5095,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5123,6 +5219,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) @@ -5614,6 +5717,7 @@ internal class SubscriptionChangeRetrieveResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -5737,6 +5841,13 @@ internal class SubscriptionChangeRetrieveResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .quantity(1.0) 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 fa2ac6848..4d80872c9 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 @@ -65,6 +65,7 @@ internal class SubscriptionCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -79,6 +80,11 @@ internal class SubscriptionCreateParamsTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.AddPrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -124,6 +130,7 @@ internal class SubscriptionCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -228,6 +235,7 @@ internal class SubscriptionCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -242,6 +250,11 @@ internal class SubscriptionCreateParamsTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.ReplacePrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -286,6 +299,7 @@ internal class SubscriptionCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -359,6 +373,7 @@ internal class SubscriptionCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -373,6 +388,11 @@ internal class SubscriptionCreateParamsTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.AddPrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -420,6 +440,7 @@ internal class SubscriptionCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -524,6 +545,7 @@ internal class SubscriptionCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -538,6 +560,11 @@ internal class SubscriptionCreateParamsTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.ReplacePrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -584,6 +611,7 @@ internal class SubscriptionCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -656,6 +684,7 @@ internal class SubscriptionCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -670,6 +699,11 @@ internal class SubscriptionCreateParamsTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.AddPrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -715,6 +749,7 @@ internal class SubscriptionCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -826,6 +861,7 @@ internal class SubscriptionCreateParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -840,6 +876,11 @@ internal class SubscriptionCreateParamsTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.ReplacePrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -884,6 +925,7 @@ internal class SubscriptionCreateParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) 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 0ae21fa3e..b10c24d7e 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 @@ -76,6 +76,7 @@ internal class SubscriptionFetchCostsResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -167,6 +168,13 @@ internal class SubscriptionFetchCostsResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -238,6 +246,7 @@ internal class SubscriptionFetchCostsResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -321,6 +330,13 @@ internal class SubscriptionFetchCostsResponseTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") @@ -403,6 +419,7 @@ internal class SubscriptionFetchCostsResponseTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -494,6 +511,13 @@ internal class SubscriptionFetchCostsResponseTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .priceId("price_id") 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 4494ff91e..935329164 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 @@ -37,6 +37,7 @@ internal class SubscriptionPriceIntervalsParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -52,6 +53,11 @@ internal class SubscriptionPriceIntervalsParamsTest { .build() ) .maximumAmount(0.0) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Add.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount(0.0) .price( NewFloatingUnitPrice.builder() @@ -96,6 +102,7 @@ internal class SubscriptionPriceIntervalsParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -152,6 +159,11 @@ internal class SubscriptionPriceIntervalsParamsTest { .quantity(5L) .build() ) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Edit.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") .build() @@ -204,6 +216,7 @@ internal class SubscriptionPriceIntervalsParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -220,6 +233,11 @@ internal class SubscriptionPriceIntervalsParamsTest { .build() ) .maximumAmount(0.0) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Add.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount(0.0) .price( NewFloatingUnitPrice.builder() @@ -266,6 +284,7 @@ internal class SubscriptionPriceIntervalsParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -323,6 +342,11 @@ internal class SubscriptionPriceIntervalsParamsTest { .quantity(5L) .build() ) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Edit.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") .build() @@ -362,6 +386,7 @@ internal class SubscriptionPriceIntervalsParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -377,6 +402,11 @@ internal class SubscriptionPriceIntervalsParamsTest { .build() ) .maximumAmount(0.0) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Add.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount(0.0) .price( NewFloatingUnitPrice.builder() @@ -421,6 +451,7 @@ internal class SubscriptionPriceIntervalsParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -479,6 +510,11 @@ internal class SubscriptionPriceIntervalsParamsTest { .quantity(5L) .build() ) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Edit.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") .build() 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 c39d53054..e794907f8 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 @@ -67,6 +67,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -81,6 +82,12 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.AddPrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -126,6 +133,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -221,6 +229,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -235,6 +244,12 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.ReplacePrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -279,6 +294,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -366,6 +382,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -380,6 +397,12 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.AddPrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -427,6 +450,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -522,6 +546,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -536,6 +561,13 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.ReplacePrice + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -582,6 +614,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -655,6 +688,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -669,6 +703,12 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.AddPrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -714,6 +754,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -812,6 +853,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -826,6 +868,12 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.ReplacePrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -870,6 +918,7 @@ internal class SubscriptionSchedulePlanChangeParamsTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) 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 decfe4eee..f5f2119b7 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 @@ -421,6 +421,7 @@ internal class SubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -500,6 +501,13 @@ internal class SubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -584,6 +592,7 @@ internal class SubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -663,10 +672,22 @@ internal class SubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1093,6 +1114,7 @@ internal class SubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1170,6 +1192,13 @@ internal class SubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -1249,6 +1278,7 @@ internal class SubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1326,10 +1356,22 @@ internal class SubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) assertThat(subscription.redeemedCoupon()) @@ -1762,6 +1804,7 @@ internal class SubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1841,6 +1884,13 @@ internal class SubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -1925,6 +1975,7 @@ internal class SubscriptionTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2004,10 +2055,22 @@ internal class SubscriptionTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( 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 93ca1b208..b42ac5aa4 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 @@ -457,6 +457,7 @@ internal class SubscriptionsTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -548,6 +549,13 @@ internal class SubscriptionsTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -646,6 +654,7 @@ internal class SubscriptionsTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -737,10 +746,22 @@ internal class SubscriptionsTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1187,6 +1208,7 @@ internal class SubscriptionsTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1270,6 +1292,13 @@ internal class SubscriptionsTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -1359,6 +1388,7 @@ internal class SubscriptionsTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -1442,10 +1472,22 @@ internal class SubscriptionsTest { .dimensionalPriceGroupId("dimensional_price_group_id") .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( @@ -1915,6 +1957,7 @@ internal class SubscriptionsTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2006,6 +2049,13 @@ internal class SubscriptionsTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .product( @@ -2104,6 +2154,7 @@ internal class SubscriptionsTest { .addValue("string") .build() ) + .licenseTypeId("license_type_id") .build() ) .currency("currency") @@ -2195,10 +2246,22 @@ internal class SubscriptionsTest { ) .build() ) + .licenseType( + Price.UnitPrice.LicenseType.builder() + .id("id") + .groupingKey("grouping_key") + .name("name") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") + .metricParameterOverrides( + PriceInterval.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) .redeemedCoupon( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/BetaServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/BetaServiceAsyncTest.kt index 0093f1b67..30ef543f5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/BetaServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/BetaServiceAsyncTest.kt @@ -88,6 +88,7 @@ internal class BetaServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -141,6 +142,7 @@ internal class BetaServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -217,6 +219,7 @@ internal class BetaServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -270,6 +273,7 @@ internal class BetaServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncTest.kt index 61350631a..c58df3b7b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/CreditBlockServiceAsyncTest.kt @@ -38,4 +38,19 @@ internal class CreditBlockServiceAsyncTest { val response = future.get() } + + @Test + fun listInvoices() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val creditBlockServiceAsync = client.creditBlocks() + + val responseFuture = creditBlockServiceAsync.listInvoices("block_id") + + val response = responseFuture.get() + response.validate() + } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncTest.kt index 636faaff3..cee92ba5d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncTest.kt @@ -9,6 +9,7 @@ import com.withorb.api.models.InvoiceCreateParams import com.withorb.api.models.InvoiceDeleteLineItemParams import com.withorb.api.models.InvoiceFetchUpcomingParams import com.withorb.api.models.InvoiceIssueParams +import com.withorb.api.models.InvoiceIssueSummaryParams import com.withorb.api.models.InvoiceMarkPaidParams import com.withorb.api.models.InvoiceUpdateParams import com.withorb.api.models.PercentageDiscount @@ -199,6 +200,27 @@ internal class InvoiceServiceAsyncTest { invoice.validate() } + @Test + fun issueSummary() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val invoiceServiceAsync = client.invoices() + + val responseFuture = + invoiceServiceAsync.issueSummary( + InvoiceIssueSummaryParams.builder() + .invoiceId("invoice_id") + .synchronous(true) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Test fun listSummary() { val client = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/LicenseServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/LicenseServiceAsyncTest.kt new file mode 100644 index 000000000..b620e553e --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/LicenseServiceAsyncTest.kt @@ -0,0 +1,117 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClientAsync +import com.withorb.api.models.LicenseCreateParams +import com.withorb.api.models.LicenseDeactivateParams +import com.withorb.api.models.LicenseListParams +import com.withorb.api.models.LicenseRetrieveByExternalIdParams +import java.time.LocalDate +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class LicenseServiceAsyncTest { + + @Test + fun create() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseServiceAsync = client.licenses() + + val licenseFuture = + licenseServiceAsync.create( + LicenseCreateParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .endDate(LocalDate.parse("2026-01-27")) + .startDate(LocalDate.parse("2026-01-27")) + .build() + ) + + val license = licenseFuture.get() + license.validate() + } + + @Test + fun retrieve() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseServiceAsync = client.licenses() + + val licenseFuture = licenseServiceAsync.retrieve("license_id") + + val license = licenseFuture.get() + license.validate() + } + + @Test + fun list() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseServiceAsync = client.licenses() + + val pageFuture = + licenseServiceAsync.list( + LicenseListParams.builder().subscriptionId("subscription_id").build() + ) + + val page = pageFuture.get() + page.response().validate() + } + + @Test + fun deactivate() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseServiceAsync = client.licenses() + + val responseFuture = + licenseServiceAsync.deactivate( + LicenseDeactivateParams.builder() + .licenseId("license_id") + .endDate(LocalDate.parse("2026-01-27")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Test + fun retrieveByExternalId() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseServiceAsync = client.licenses() + + val responseFuture = + licenseServiceAsync.retrieveByExternalId( + LicenseRetrieveByExternalIdParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsyncTest.kt new file mode 100644 index 000000000..03ca7cf52 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/LicenseTypeServiceAsyncTest.kt @@ -0,0 +1,61 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClientAsync +import com.withorb.api.models.LicenseTypeCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class LicenseTypeServiceAsyncTest { + + @Test + fun create() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseTypeServiceAsync = client.licenseTypes() + + val licenseTypeFuture = + licenseTypeServiceAsync.create( + LicenseTypeCreateParams.builder().groupingKey("grouping_key").name("name").build() + ) + + val licenseType = licenseTypeFuture.get() + licenseType.validate() + } + + @Test + fun retrieve() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseTypeServiceAsync = client.licenseTypes() + + val licenseTypeFuture = licenseTypeServiceAsync.retrieve("license_type_id") + + val licenseType = licenseTypeFuture.get() + licenseType.validate() + } + + @Test + fun list() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseTypeServiceAsync = client.licenseTypes() + + val pageFuture = licenseTypeServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PlanServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PlanServiceAsyncTest.kt index 709bba422..d11d9a609 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PlanServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PlanServiceAsyncTest.kt @@ -57,6 +57,7 @@ internal class PlanServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -110,6 +111,7 @@ internal class PlanServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PriceServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PriceServiceAsyncTest.kt index 2738e47c1..0604d002f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PriceServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/PriceServiceAsyncTest.kt @@ -77,6 +77,7 @@ internal class PriceServiceAsyncTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -150,6 +151,11 @@ internal class PriceServiceAsyncTest { .externalCustomerId("external_customer_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateParams.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) @@ -180,6 +186,12 @@ internal class PriceServiceAsyncTest { .addGroupingKey( "case when my_event_type = 'foo' then true else false end" ) + .metricParameterOverrides( + PriceEvaluateMultipleParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -229,6 +241,7 @@ internal class PriceServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -282,6 +295,13 @@ internal class PriceServiceAsyncTest { .addGroupingKey( "case when my_event_type = 'foo' then true else false end" ) + .metricParameterOverrides( + PriceEvaluatePreviewEventsParams.PriceEvaluation + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -331,6 +351,7 @@ internal class PriceServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncTest.kt index 513e0f995..6c0011c60 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncTest.kt @@ -103,6 +103,7 @@ internal class SubscriptionServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -117,6 +118,11 @@ internal class SubscriptionServiceAsyncTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.AddPrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -168,6 +174,7 @@ internal class SubscriptionServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -274,6 +281,7 @@ internal class SubscriptionServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -288,6 +296,12 @@ internal class SubscriptionServiceAsyncTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.ReplacePrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -338,6 +352,7 @@ internal class SubscriptionServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -548,6 +563,7 @@ internal class SubscriptionServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -564,6 +580,12 @@ internal class SubscriptionServiceAsyncTest { .build() ) .maximumAmount(0.0) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Add.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount(0.0) .price( NewFloatingUnitPrice.builder() @@ -614,6 +636,7 @@ internal class SubscriptionServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -673,6 +696,12 @@ internal class SubscriptionServiceAsyncTest { .quantity(5L) .build() ) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Edit.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") .build() @@ -784,6 +813,7 @@ internal class SubscriptionServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -798,6 +828,13 @@ internal class SubscriptionServiceAsyncTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.AddPrice + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -849,6 +886,7 @@ internal class SubscriptionServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -946,6 +984,7 @@ internal class SubscriptionServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -960,6 +999,13 @@ internal class SubscriptionServiceAsyncTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.ReplacePrice + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -1010,6 +1056,7 @@ internal class SubscriptionServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/beta/ExternalPlanIdServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/beta/ExternalPlanIdServiceAsyncTest.kt index 304861b85..46690bd97 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/beta/ExternalPlanIdServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/beta/ExternalPlanIdServiceAsyncTest.kt @@ -88,6 +88,7 @@ internal class ExternalPlanIdServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -141,6 +142,7 @@ internal class ExternalPlanIdServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -217,6 +219,7 @@ internal class ExternalPlanIdServiceAsyncTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -270,6 +273,7 @@ internal class ExternalPlanIdServiceAsyncTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncTest.kt index 8fffa8b4e..b6c3884c8 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncTest.kt @@ -73,6 +73,7 @@ internal class LedgerServiceAsyncTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) @@ -143,6 +144,7 @@ internal class LedgerServiceAsyncTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsyncTest.kt new file mode 100644 index 000000000..445726bb1 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/licenses/ExternalLicenseServiceAsyncTest.kt @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async.licenses + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClientAsync +import com.withorb.api.models.LicenseExternalLicenseGetUsageParams +import java.time.LocalDate +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class ExternalLicenseServiceAsyncTest { + + @Test + fun getUsage() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val externalLicenseServiceAsync = client.licenses().externalLicenses() + + val responseFuture = + externalLicenseServiceAsync.getUsage( + LicenseExternalLicenseGetUsageParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsyncTest.kt new file mode 100644 index 000000000..72f120b68 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/licenses/UsageServiceAsyncTest.kt @@ -0,0 +1,66 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.async.licenses + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClientAsync +import com.withorb.api.models.LicenseUsageGetAllUsageParams +import com.withorb.api.models.LicenseUsageGetUsageParams +import java.time.LocalDate +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class UsageServiceAsyncTest { + + @Test + fun getAllUsage() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val usageServiceAsync = client.licenses().usage() + + val responseFuture = + usageServiceAsync.getAllUsage( + LicenseUsageGetAllUsageParams.builder() + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Test + fun getUsage() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val usageServiceAsync = client.licenses().usage() + + val responseFuture = + usageServiceAsync.getUsage( + LicenseUsageGetUsageParams.builder() + .licenseId("license_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/BetaServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/BetaServiceTest.kt index 7f538b370..4cd03a79c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/BetaServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/BetaServiceTest.kt @@ -88,6 +88,7 @@ internal class BetaServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -141,6 +142,7 @@ internal class BetaServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -217,6 +219,7 @@ internal class BetaServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -270,6 +273,7 @@ internal class BetaServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CreditBlockServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CreditBlockServiceTest.kt index b52247712..9e7a7b279 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CreditBlockServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CreditBlockServiceTest.kt @@ -35,4 +35,18 @@ internal class CreditBlockServiceTest { creditBlockService.delete("block_id") } + + @Test + fun listInvoices() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val creditBlockService = client.creditBlocks() + + val response = creditBlockService.listInvoices("block_id") + + response.validate() + } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/InvoiceServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/InvoiceServiceTest.kt index 5a0c09455..322153858 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/InvoiceServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/InvoiceServiceTest.kt @@ -9,6 +9,7 @@ import com.withorb.api.models.InvoiceCreateParams import com.withorb.api.models.InvoiceDeleteLineItemParams import com.withorb.api.models.InvoiceFetchUpcomingParams import com.withorb.api.models.InvoiceIssueParams +import com.withorb.api.models.InvoiceIssueSummaryParams import com.withorb.api.models.InvoiceMarkPaidParams import com.withorb.api.models.InvoiceUpdateParams import com.withorb.api.models.PercentageDiscount @@ -190,6 +191,26 @@ internal class InvoiceServiceTest { invoice.validate() } + @Test + fun issueSummary() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val invoiceService = client.invoices() + + val response = + invoiceService.issueSummary( + InvoiceIssueSummaryParams.builder() + .invoiceId("invoice_id") + .synchronous(true) + .build() + ) + + response.validate() + } + @Test fun listSummary() { val client = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/LicenseServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/LicenseServiceTest.kt new file mode 100644 index 000000000..739be45b4 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/LicenseServiceTest.kt @@ -0,0 +1,112 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClient +import com.withorb.api.models.LicenseCreateParams +import com.withorb.api.models.LicenseDeactivateParams +import com.withorb.api.models.LicenseListParams +import com.withorb.api.models.LicenseRetrieveByExternalIdParams +import java.time.LocalDate +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class LicenseServiceTest { + + @Test + fun create() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseService = client.licenses() + + val license = + licenseService.create( + LicenseCreateParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .endDate(LocalDate.parse("2026-01-27")) + .startDate(LocalDate.parse("2026-01-27")) + .build() + ) + + license.validate() + } + + @Test + fun retrieve() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseService = client.licenses() + + val license = licenseService.retrieve("license_id") + + license.validate() + } + + @Test + fun list() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseService = client.licenses() + + val page = + licenseService.list( + LicenseListParams.builder().subscriptionId("subscription_id").build() + ) + + page.response().validate() + } + + @Test + fun deactivate() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseService = client.licenses() + + val response = + licenseService.deactivate( + LicenseDeactivateParams.builder() + .licenseId("license_id") + .endDate(LocalDate.parse("2026-01-27")) + .build() + ) + + response.validate() + } + + @Test + fun retrieveByExternalId() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseService = client.licenses() + + val response = + licenseService.retrieveByExternalId( + LicenseRetrieveByExternalIdParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .build() + ) + + response.validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/LicenseTypeServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/LicenseTypeServiceTest.kt new file mode 100644 index 000000000..e86dcf903 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/LicenseTypeServiceTest.kt @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClient +import com.withorb.api.models.LicenseTypeCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class LicenseTypeServiceTest { + + @Test + fun create() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseTypeService = client.licenseTypes() + + val licenseType = + licenseTypeService.create( + LicenseTypeCreateParams.builder().groupingKey("grouping_key").name("name").build() + ) + + licenseType.validate() + } + + @Test + fun retrieve() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseTypeService = client.licenseTypes() + + val licenseType = licenseTypeService.retrieve("license_type_id") + + licenseType.validate() + } + + @Test + fun list() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val licenseTypeService = client.licenseTypes() + + val page = licenseTypeService.list() + + page.response().validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PlanServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PlanServiceTest.kt index 62e6a8a4e..f8787dff0 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PlanServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PlanServiceTest.kt @@ -57,6 +57,7 @@ internal class PlanServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -110,6 +111,7 @@ internal class PlanServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PriceServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PriceServiceTest.kt index de3c5a9ae..bad539a3b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PriceServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/PriceServiceTest.kt @@ -77,6 +77,7 @@ internal class PriceServiceTest { .durationUnit(NewBillingCycleConfiguration.DurationUnit.DAY) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -147,6 +148,11 @@ internal class PriceServiceTest { .externalCustomerId("external_customer_id") .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") + .metricParameterOverrides( + PriceEvaluateParams.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .build() ) @@ -176,6 +182,12 @@ internal class PriceServiceTest { .addGroupingKey( "case when my_event_type = 'foo' then true else false end" ) + .metricParameterOverrides( + PriceEvaluateMultipleParams.PriceEvaluation.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -225,6 +237,7 @@ internal class PriceServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -277,6 +290,13 @@ internal class PriceServiceTest { .addGroupingKey( "case when my_event_type = 'foo' then true else false end" ) + .metricParameterOverrides( + PriceEvaluatePreviewEventsParams.PriceEvaluation + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .price( NewFloatingUnitPrice.builder() .cadence(NewFloatingUnitPrice.Cadence.ANNUAL) @@ -326,6 +346,7 @@ internal class PriceServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) 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 457bb6fcd..96de618eb 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 @@ -103,6 +103,7 @@ internal class SubscriptionServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -117,6 +118,11 @@ internal class SubscriptionServiceTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.AddPrice.MetricParameterOverrides.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -168,6 +174,7 @@ internal class SubscriptionServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -274,6 +281,7 @@ internal class SubscriptionServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -288,6 +296,12 @@ internal class SubscriptionServiceTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionCreateParams.ReplacePrice.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -338,6 +352,7 @@ internal class SubscriptionServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -540,6 +555,7 @@ internal class SubscriptionServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -556,6 +572,12 @@ internal class SubscriptionServiceTest { .build() ) .maximumAmount(0.0) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Add.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount(0.0) .price( NewFloatingUnitPrice.builder() @@ -606,6 +628,7 @@ internal class SubscriptionServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewFloatingUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -665,6 +688,12 @@ internal class SubscriptionServiceTest { .quantity(5L) .build() ) + .metricParameterOverrides( + SubscriptionPriceIntervalsParams.Edit.MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addUsageCustomerId("string") .build() @@ -774,6 +803,7 @@ internal class SubscriptionServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -788,6 +818,13 @@ internal class SubscriptionServiceTest { .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.AddPrice + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .planPhaseOrder(0L) .price( @@ -839,6 +876,7 @@ internal class SubscriptionServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -936,6 +974,7 @@ internal class SubscriptionServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -950,6 +989,13 @@ internal class SubscriptionServiceTest { .externalPriceId("external_price_id") .fixedPriceQuantity(2.0) .maximumAmount("1.23") + .metricParameterOverrides( + SubscriptionSchedulePlanChangeParams.ReplacePrice + .MetricParameterOverrides + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .minimumAmount("1.23") .price( NewSubscriptionUnitPrice.builder() @@ -1000,6 +1046,7 @@ internal class SubscriptionServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewSubscriptionUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/beta/ExternalPlanIdServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/beta/ExternalPlanIdServiceTest.kt index 961704179..5ec00a8bc 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/beta/ExternalPlanIdServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/beta/ExternalPlanIdServiceTest.kt @@ -88,6 +88,7 @@ internal class ExternalPlanIdServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -141,6 +142,7 @@ internal class ExternalPlanIdServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) @@ -217,6 +219,7 @@ internal class ExternalPlanIdServiceTest { .build() ) .itemId("item_id") + .licenseTypeId("license_type_id") .perUnitCostBasis("per_unit_cost_basis") .build() ) @@ -270,6 +273,7 @@ internal class ExternalPlanIdServiceTest { ) .build() ) + .licenseTypeId("license_type_id") .metadata( NewPlanUnitPrice.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("string")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceTest.kt index 3db03f154..ded8e622d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceTest.kt @@ -72,6 +72,7 @@ internal class LedgerServiceTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) @@ -141,6 +142,7 @@ internal class LedgerServiceTest { .customDueDate(LocalDate.parse("2019-12-27")) .invoiceDate(LocalDate.parse("2019-12-27")) .itemId("item_id") + .markAsPaid(true) .memo("memo") .netTerms(0L) .requireSuccessfulPayment(true) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseServiceTest.kt new file mode 100644 index 000000000..3bb995d17 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/licenses/ExternalLicenseServiceTest.kt @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking.licenses + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClient +import com.withorb.api.models.LicenseExternalLicenseGetUsageParams +import java.time.LocalDate +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class ExternalLicenseServiceTest { + + @Test + fun getUsage() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val externalLicenseService = client.licenses().externalLicenses() + + val response = + externalLicenseService.getUsage( + LicenseExternalLicenseGetUsageParams.builder() + .externalLicenseId("external_license_id") + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + ) + + response.validate() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/licenses/UsageServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/licenses/UsageServiceTest.kt new file mode 100644 index 000000000..34ec9d205 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/licenses/UsageServiceTest.kt @@ -0,0 +1,64 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.services.blocking.licenses + +import com.withorb.api.TestServerExtension +import com.withorb.api.client.okhttp.OrbOkHttpClient +import com.withorb.api.models.LicenseUsageGetAllUsageParams +import com.withorb.api.models.LicenseUsageGetUsageParams +import java.time.LocalDate +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class UsageServiceTest { + + @Test + fun getAllUsage() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val usageService = client.licenses().usage() + + val response = + usageService.getAllUsage( + LicenseUsageGetAllUsageParams.builder() + .licenseTypeId("license_type_id") + .subscriptionId("subscription_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + ) + + response.validate() + } + + @Test + fun getUsage() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val usageService = client.licenses().usage() + + val response = + usageService.getUsage( + LicenseUsageGetUsageParams.builder() + .licenseId("license_id") + .cursor("cursor") + .endDate(LocalDate.parse("2019-12-27")) + .addGroupBy("string") + .limit(1L) + .startDate(LocalDate.parse("2019-12-27")) + .build() + ) + + response.validate() + } +} diff --git a/orb-java-example/build.gradle.kts b/orb-java-example/build.gradle.kts index 3e7cb2236..818cd7587 100644 --- a/orb-java-example/build.gradle.kts +++ b/orb-java-example/build.gradle.kts @@ -8,7 +8,8 @@ repositories { } dependencies { - implementation(project(":orb-java")) + implementation(project(":orb-java-core")) + implementation(project(":orb-java-client-okhttp")) } tasks.withType().configureEach { diff --git a/orb-java-proguard-test/build.gradle.kts b/orb-java-proguard-test/build.gradle.kts index a738f0f3e..e68c59a0b 100644 --- a/orb-java-proguard-test/build.gradle.kts +++ b/orb-java-proguard-test/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { testImplementation(project(":orb-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") } diff --git a/orb-java-proguard-test/src/test/kotlin/com/withorb/api/proguard/ProGuardCompatibilityTest.kt b/orb-java-proguard-test/src/test/kotlin/com/withorb/api/proguard/ProGuardCompatibilityTest.kt index ce15e3f90..55b06b366 100644 --- a/orb-java-proguard-test/src/test/kotlin/com/withorb/api/proguard/ProGuardCompatibilityTest.kt +++ b/orb-java-proguard-test/src/test/kotlin/com/withorb/api/proguard/ProGuardCompatibilityTest.kt @@ -68,6 +68,8 @@ internal class ProGuardCompatibilityTest { assertThat(client.dimensionalPriceGroups()).isNotNull() assertThat(client.subscriptionChanges()).isNotNull() assertThat(client.creditBlocks()).isNotNull() + assertThat(client.licenseTypes()).isNotNull() + assertThat(client.licenses()).isNotNull() } @Test diff --git a/scripts/build b/scripts/build index f40634826..16a2b00db 100755 --- a/scripts/build +++ b/scripts/build @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Building classes" -./gradlew build testClasses -x test +./gradlew build testClasses "$@" -x test diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts index 548d15272..10f3c7055 100755 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -96,8 +96,52 @@ generate_instructions() {

Stainless SDK Maven Repository

This is the Maven repository for your Stainless Java SDK build.

-

Directions

-

To use the uploaded Maven repository, add the following to your project's pom.xml:

+

Project configuration

+ +

The details depend on whether you're using Maven or Gradle as your build tool.

+ +

Maven

+ +

Add the following to your project's pom.xml:

+
<repositories>
+    <repository>
+        <id>stainless-sdk-repo</id>
+        <url>https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn</url>
+    </repository>
+</repositories>
+ +

Gradle

+

Add the following to your build.gradle file:

+
repositories {
+    maven {
+        url "https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn"
+    }
+}
+ +
+

Configuring authentication (if required)

+ +

Some accounts may require authentication to access the repository. If so, use the + following instructions, replacing YOUR_STAINLESS_API_TOKEN with your actual token.

+ +

Maven with authentication

+ +

First, ensure you have the following in your Maven settings.xml for repo authentication:

+
<servers>
+    <server>
+        <id>stainless-sdk-repo</id>
+        <configuration>
+            <httpHeaders>
+                <property>
+                    <name>Authorization</name>
+                    <value>Bearer YOUR_STAINLESS_API_TOKEN</value>
+                </property>
+            </httpHeaders>
+        </configuration>
+    </server>
+</servers>
+ +

Then, add the following to your project's pom.xml:

<repositories>
     <repository>
         <id>stainless-sdk-repo</id>
@@ -105,14 +149,24 @@ generate_instructions() {
     </repository>
 </repositories>
-

If you're using Gradle, add the following to your build.gradle file:

+

Gradle with authentication

+

Add the following to your build.gradle file:

repositories {
     maven {
-        url 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'
+        url "https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn"
+        credentials(HttpHeaderCredentials) {
+            name = "Authorization"
+            value = "Bearer YOUR_STAINLESS_API_TOKEN"
+        }
+        authentication {
+            header(HttpHeaderAuthentication)
+        }
     }
 }
+
-

Once you've added the repository, you can include dependencies from it as usual. See your +

Using the repository

+

Once you've configured the repository, you can include dependencies from it as usual. See your project README for more details.