diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c523ce19..c3c95522 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.8.0" + ".": "1.9.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 82cec55f..c03739d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1aabbd8715a871e993abf67f0bf9c1d6793b4f197c4b2f11fc7a76453590cd6c.yml -openapi_spec_hash: 3e5878f87e74881d882a69e1ccdc25a3 -config_hash: 1f535c1fa222aacf28b636eed21bec72 +configured_endpoints: 118 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml +openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025 +config_hash: 5135e9237207028f293049a77428c775 diff --git a/CHANGELOG.md b/CHANGELOG.md index 80798a38..a326cfbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.9.0 (2025-07-26) + +Full Changelog: [v1.8.0...v1.9.0](https://github.com/orbcorp/orb-java/compare/v1.8.0...v1.9.0) + +### Features + +* **api:** api update ([8d61cd4](https://github.com/orbcorp/orb-java/commit/8d61cd4c4b5f984f5020449efe54bcb8aa1de90e)) + ## 1.8.0 (2025-07-24) Full Changelog: [v1.7.0...v1.8.0](https://github.com/orbcorp/orb-java/compare/v1.7.0...v1.8.0) diff --git a/README.md b/README.md index cdb8cd80..b0b339ee 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.8.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.9.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.8.0") +implementation("com.withorb.api:orb-java:1.9.0") ``` ### Maven @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:1.8.0") com.withorb.api orb-java - 1.8.0 + 1.9.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 18b4cd8b..961c7eab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ allprojects { group = "com.withorb.api" - version = "1.8.0" // x-release-please-version + version = "1.9.0" // x-release-please-version } 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 4f131550..8352f85c 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 @@ -281,106 +281,145 @@ private constructor( * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -998,106 +1037,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = taxId(JsonField.ofNullable(taxId)) 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 5f754620..b7f27ed3 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 @@ -186,106 +186,145 @@ private constructor( * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -886,106 +925,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = apply { body.taxId(taxId) } @@ -1399,106 +1477,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -2167,106 +2284,145 @@ private constructor( * to the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = taxId(JsonField.ofNullable(taxId)) 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 64c525d7..d65604b7 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 @@ -22,106 +22,145 @@ import kotlin.jvm.optionals.getOrNull * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 | */ class CustomerTaxId private constructor( @@ -342,52 +381,84 @@ private constructor( @JvmField val AE = of("AE") + @JvmField val AL = of("AL") + + @JvmField val AM = of("AM") + + @JvmField val AO = of("AO") + @JvmField val AR = of("AR") @JvmField val AT = of("AT") @JvmField val AU = of("AU") + @JvmField val AW = of("AW") + + @JvmField val AZ = of("AZ") + + @JvmField val BA = of("BA") + + @JvmField val BB = of("BB") + + @JvmField val BD = of("BD") + @JvmField val BE = of("BE") + @JvmField val BF = of("BF") + @JvmField val BG = of("BG") @JvmField val BH = of("BH") + @JvmField val BJ = of("BJ") + @JvmField val BO = of("BO") @JvmField val BR = of("BR") + @JvmField val BS = of("BS") + + @JvmField val BY = of("BY") + @JvmField val CA = of("CA") + @JvmField val CD = of("CD") + @JvmField val CH = of("CH") @JvmField val CL = of("CL") + @JvmField val CM = of("CM") + @JvmField val CN = of("CN") @JvmField val CO = of("CO") @JvmField val CR = of("CR") + @JvmField val CV = of("CV") + + @JvmField val DE = of("DE") + @JvmField val CY = of("CY") @JvmField val CZ = of("CZ") - @JvmField val DE = of("DE") - @JvmField val DK = of("DK") - @JvmField val EE = of("EE") - @JvmField val DO = of("DO") @JvmField val EC = of("EC") + @JvmField val EE = of("EE") + @JvmField val EG = of("EG") @JvmField val ES = of("ES") + @JvmField val ET = of("ET") + @JvmField val EU = of("EU") @JvmField val FI = of("FI") @@ -398,6 +469,8 @@ private constructor( @JvmField val GE = of("GE") + @JvmField val GN = of("GN") + @JvmField val GR = of("GR") @JvmField val HK = of("HK") @@ -422,10 +495,16 @@ private constructor( @JvmField val KE = of("KE") + @JvmField val KG = of("KG") + + @JvmField val KH = of("KH") + @JvmField val KR = of("KR") @JvmField val KZ = of("KZ") + @JvmField val LA = of("LA") + @JvmField val LI = of("LI") @JvmField val LT = of("LT") @@ -434,6 +513,16 @@ private constructor( @JvmField val LV = of("LV") + @JvmField val MA = of("MA") + + @JvmField val MD = of("MD") + + @JvmField val ME = of("ME") + + @JvmField val MK = of("MK") + + @JvmField val MR = of("MR") + @JvmField val MT = of("MT") @JvmField val MX = of("MX") @@ -446,6 +535,8 @@ private constructor( @JvmField val NO = of("NO") + @JvmField val NP = of("NP") + @JvmField val NZ = of("NZ") @JvmField val OM = of("OM") @@ -474,26 +565,42 @@ private constructor( @JvmField val SK = of("SK") + @JvmField val SN = of("SN") + + @JvmField val SR = of("SR") + @JvmField val SV = of("SV") @JvmField val TH = of("TH") + @JvmField val TJ = of("TJ") + @JvmField val TR = of("TR") @JvmField val TW = of("TW") + @JvmField val TZ = of("TZ") + @JvmField val UA = of("UA") + @JvmField val UG = of("UG") + @JvmField val US = of("US") @JvmField val UY = of("UY") + @JvmField val UZ = of("UZ") + @JvmField val VE = of("VE") @JvmField val VN = of("VN") @JvmField val ZA = of("ZA") + @JvmField val ZM = of("ZM") + + @JvmField val ZW = of("ZW") + @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } @@ -501,34 +608,51 @@ private constructor( enum class Known { AD, AE, + AL, + AM, + AO, AR, AT, AU, + AW, + AZ, + BA, + BB, + BD, BE, + BF, BG, BH, + BJ, BO, BR, + BS, + BY, CA, + CD, CH, CL, + CM, CN, CO, CR, + CV, + DE, CY, CZ, - DE, DK, - EE, DO, EC, + EE, EG, ES, + ET, EU, FI, FR, GB, GE, + GN, GR, HK, HR, @@ -541,18 +665,27 @@ private constructor( IT, JP, KE, + KG, + KH, KR, KZ, + LA, LI, LT, LU, LV, + MA, + MD, + ME, + MK, + MR, MT, MX, MY, NG, NL, NO, + NP, NZ, OM, PE, @@ -567,16 +700,24 @@ private constructor( SG, SI, SK, + SN, + SR, SV, TH, + TJ, TR, TW, + TZ, UA, + UG, US, UY, + UZ, VE, VN, ZA, + ZM, + ZW, } /** @@ -591,34 +732,51 @@ private constructor( enum class Value { AD, AE, + AL, + AM, + AO, AR, AT, AU, + AW, + AZ, + BA, + BB, + BD, BE, + BF, BG, BH, + BJ, BO, BR, + BS, + BY, CA, + CD, CH, CL, + CM, CN, CO, CR, + CV, + DE, CY, CZ, - DE, DK, - EE, DO, EC, + EE, EG, ES, + ET, EU, FI, FR, GB, GE, + GN, GR, HK, HR, @@ -631,18 +789,27 @@ private constructor( IT, JP, KE, + KG, + KH, KR, KZ, + LA, LI, LT, LU, LV, + MA, + MD, + ME, + MK, + MR, MT, MX, MY, NG, NL, NO, + NP, NZ, OM, PE, @@ -657,16 +824,24 @@ private constructor( SG, SI, SK, + SN, + SR, SV, TH, + TJ, TR, TW, + TZ, UA, + UG, US, UY, + UZ, VE, VN, ZA, + ZM, + ZW, /** An enum member indicating that [Country] was instantiated with an unknown value. */ _UNKNOWN, } @@ -682,34 +857,51 @@ private constructor( when (this) { AD -> Value.AD AE -> Value.AE + AL -> Value.AL + AM -> Value.AM + AO -> Value.AO AR -> Value.AR AT -> Value.AT AU -> Value.AU + AW -> Value.AW + AZ -> Value.AZ + BA -> Value.BA + BB -> Value.BB + BD -> Value.BD BE -> Value.BE + BF -> Value.BF BG -> Value.BG BH -> Value.BH + BJ -> Value.BJ BO -> Value.BO BR -> Value.BR + BS -> Value.BS + BY -> Value.BY CA -> Value.CA + CD -> Value.CD CH -> Value.CH CL -> Value.CL + CM -> Value.CM CN -> Value.CN CO -> Value.CO CR -> Value.CR + CV -> Value.CV + DE -> Value.DE CY -> Value.CY CZ -> Value.CZ - DE -> Value.DE DK -> Value.DK - EE -> Value.EE DO -> Value.DO EC -> Value.EC + EE -> Value.EE EG -> Value.EG ES -> Value.ES + ET -> Value.ET EU -> Value.EU FI -> Value.FI FR -> Value.FR GB -> Value.GB GE -> Value.GE + GN -> Value.GN GR -> Value.GR HK -> Value.HK HR -> Value.HR @@ -722,18 +914,27 @@ private constructor( IT -> Value.IT JP -> Value.JP KE -> Value.KE + KG -> Value.KG + KH -> Value.KH KR -> Value.KR KZ -> Value.KZ + LA -> Value.LA LI -> Value.LI LT -> Value.LT LU -> Value.LU LV -> Value.LV + MA -> Value.MA + MD -> Value.MD + ME -> Value.ME + MK -> Value.MK + MR -> Value.MR MT -> Value.MT MX -> Value.MX MY -> Value.MY NG -> Value.NG NL -> Value.NL NO -> Value.NO + NP -> Value.NP NZ -> Value.NZ OM -> Value.OM PE -> Value.PE @@ -748,16 +949,24 @@ private constructor( SG -> Value.SG SI -> Value.SI SK -> Value.SK + SN -> Value.SN + SR -> Value.SR SV -> Value.SV TH -> Value.TH + TJ -> Value.TJ TR -> Value.TR TW -> Value.TW + TZ -> Value.TZ UA -> Value.UA + UG -> Value.UG US -> Value.US UY -> Value.UY + UZ -> Value.UZ VE -> Value.VE VN -> Value.VN ZA -> Value.ZA + ZM -> Value.ZM + ZW -> Value.ZW else -> Value._UNKNOWN } @@ -773,34 +982,51 @@ private constructor( when (this) { AD -> Known.AD AE -> Known.AE + AL -> Known.AL + AM -> Known.AM + AO -> Known.AO AR -> Known.AR AT -> Known.AT AU -> Known.AU + AW -> Known.AW + AZ -> Known.AZ + BA -> Known.BA + BB -> Known.BB + BD -> Known.BD BE -> Known.BE + BF -> Known.BF BG -> Known.BG BH -> Known.BH + BJ -> Known.BJ BO -> Known.BO BR -> Known.BR + BS -> Known.BS + BY -> Known.BY CA -> Known.CA + CD -> Known.CD CH -> Known.CH CL -> Known.CL + CM -> Known.CM CN -> Known.CN CO -> Known.CO CR -> Known.CR + CV -> Known.CV + DE -> Known.DE CY -> Known.CY CZ -> Known.CZ - DE -> Known.DE DK -> Known.DK - EE -> Known.EE DO -> Known.DO EC -> Known.EC + EE -> Known.EE EG -> Known.EG ES -> Known.ES + ET -> Known.ET EU -> Known.EU FI -> Known.FI FR -> Known.FR GB -> Known.GB GE -> Known.GE + GN -> Known.GN GR -> Known.GR HK -> Known.HK HR -> Known.HR @@ -813,18 +1039,27 @@ private constructor( IT -> Known.IT JP -> Known.JP KE -> Known.KE + KG -> Known.KG + KH -> Known.KH KR -> Known.KR KZ -> Known.KZ + LA -> Known.LA LI -> Known.LI LT -> Known.LT LU -> Known.LU LV -> Known.LV + MA -> Known.MA + MD -> Known.MD + ME -> Known.ME + MK -> Known.MK + MR -> Known.MR MT -> Known.MT MX -> Known.MX MY -> Known.MY NG -> Known.NG NL -> Known.NL NO -> Known.NO + NP -> Known.NP NZ -> Known.NZ OM -> Known.OM PE -> Known.PE @@ -839,16 +1074,24 @@ private constructor( SG -> Known.SG SI -> Known.SI SK -> Known.SK + SN -> Known.SN + SR -> Known.SR SV -> Known.SV TH -> Known.TH + TJ -> Known.TJ TR -> Known.TR TW -> Known.TW + TZ -> Known.TZ UA -> Known.UA + UG -> Known.UG US -> Known.US UY -> Known.UY + UZ -> Known.UZ VE -> Known.VE VN -> Known.VN ZA -> Known.ZA + ZM -> Known.ZM + ZW -> Known.ZW else -> throw OrbInvalidDataException("Unknown Country: $value") } @@ -922,6 +1165,12 @@ private constructor( @JvmField val AE_TRN = of("ae_trn") + @JvmField val AL_TIN = of("al_tin") + + @JvmField val AM_TIN = of("am_tin") + + @JvmField val AO_TIN = of("ao_tin") + @JvmField val AR_CUIT = of("ar_cuit") @JvmField val EU_VAT = of("eu_vat") @@ -930,16 +1179,34 @@ private constructor( @JvmField val AU_ARN = of("au_arn") + @JvmField val AW_TIN = of("aw_tin") + + @JvmField val AZ_TIN = of("az_tin") + + @JvmField val BA_TIN = of("ba_tin") + + @JvmField val BB_TIN = of("bb_tin") + + @JvmField val BD_BIN = of("bd_bin") + + @JvmField val BF_IFU = of("bf_ifu") + @JvmField val BG_UIC = of("bg_uic") @JvmField val BH_VAT = of("bh_vat") + @JvmField val BJ_IFU = of("bj_ifu") + @JvmField val BO_TIN = of("bo_tin") @JvmField val BR_CNPJ = of("br_cnpj") @JvmField val BR_CPF = of("br_cpf") + @JvmField val BS_TIN = of("bs_tin") + + @JvmField val BY_TIN = of("by_tin") + @JvmField val CA_BN = of("ca_bn") @JvmField val CA_GST_HST = of("ca_gst_hst") @@ -952,16 +1219,26 @@ private constructor( @JvmField val CA_QST = of("ca_qst") + @JvmField val CD_NIF = of("cd_nif") + + @JvmField val CH_UID = of("ch_uid") + @JvmField val CH_VAT = of("ch_vat") @JvmField val CL_TIN = of("cl_tin") + @JvmField val CM_NIU = of("cm_niu") + @JvmField val CN_TIN = of("cn_tin") @JvmField val CO_NIT = of("co_nit") @JvmField val CR_TIN = of("cr_tin") + @JvmField val CV_NIF = of("cv_nif") + + @JvmField val DE_STN = of("de_stn") + @JvmField val DO_RCN = of("do_rcn") @JvmField val EC_RUC = of("ec_ruc") @@ -970,14 +1247,20 @@ private constructor( @JvmField val ES_CIF = of("es_cif") + @JvmField val ET_TIN = of("et_tin") + @JvmField val EU_OSS_VAT = of("eu_oss_vat") @JvmField val GB_VAT = of("gb_vat") @JvmField val GE_VAT = of("ge_vat") + @JvmField val GN_NIF = of("gn_nif") + @JvmField val HK_BR = of("hk_br") + @JvmField val HR_OIB = of("hr_oib") + @JvmField val HU_TIN = of("hu_tin") @JvmField val ID_NPWP = of("id_npwp") @@ -996,12 +1279,30 @@ private constructor( @JvmField val KE_PIN = of("ke_pin") + @JvmField val KG_TIN = of("kg_tin") + + @JvmField val KH_TIN = of("kh_tin") + @JvmField val KR_BRN = of("kr_brn") @JvmField val KZ_BIN = of("kz_bin") + @JvmField val LA_TIN = of("la_tin") + @JvmField val LI_UID = of("li_uid") + @JvmField val LI_VAT = of("li_vat") + + @JvmField val MA_VAT = of("ma_vat") + + @JvmField val MD_VAT = of("md_vat") + + @JvmField val ME_PIB = of("me_pib") + + @JvmField val MK_VAT = of("mk_vat") + + @JvmField val MR_NIF = of("mr_nif") + @JvmField val MX_RFC = of("mx_rfc") @JvmField val MY_FRP = of("my_frp") @@ -1016,6 +1317,8 @@ private constructor( @JvmField val NO_VOEC = of("no_voec") + @JvmField val NP_PAN = of("np_pan") + @JvmField val NZ_GST = of("nz_gst") @JvmField val OM_VAT = of("om_vat") @@ -1040,26 +1343,44 @@ private constructor( @JvmField val SI_TIN = of("si_tin") + @JvmField val SN_NINEA = of("sn_ninea") + + @JvmField val SR_FIN = of("sr_fin") + @JvmField val SV_NIT = of("sv_nit") @JvmField val TH_VAT = of("th_vat") + @JvmField val TJ_TIN = of("tj_tin") + @JvmField val TR_TIN = of("tr_tin") @JvmField val TW_VAT = of("tw_vat") + @JvmField val TZ_VAT = of("tz_vat") + @JvmField val UA_VAT = of("ua_vat") + @JvmField val UG_TIN = of("ug_tin") + @JvmField val US_EIN = of("us_ein") @JvmField val UY_RUC = of("uy_ruc") + @JvmField val UZ_TIN = of("uz_tin") + + @JvmField val UZ_VAT = of("uz_vat") + @JvmField val VE_RIF = of("ve_rif") @JvmField val VN_TIN = of("vn_tin") @JvmField val ZA_VAT = of("za_vat") + @JvmField val ZM_TIN = of("zm_tin") + + @JvmField val ZW_TIN = of("zw_tin") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1067,34 +1388,54 @@ private constructor( enum class Known { AD_NRT, AE_TRN, + AL_TIN, + AM_TIN, + AO_TIN, AR_CUIT, EU_VAT, AU_ABN, AU_ARN, + AW_TIN, + AZ_TIN, + BA_TIN, + BB_TIN, + BD_BIN, + BF_IFU, BG_UIC, BH_VAT, + BJ_IFU, BO_TIN, BR_CNPJ, BR_CPF, + BS_TIN, + BY_TIN, CA_BN, CA_GST_HST, CA_PST_BC, CA_PST_MB, CA_PST_SK, CA_QST, + CD_NIF, + CH_UID, CH_VAT, CL_TIN, + CM_NIU, CN_TIN, CO_NIT, CR_TIN, + CV_NIF, + DE_STN, DO_RCN, EC_RUC, EG_TIN, ES_CIF, + ET_TIN, EU_OSS_VAT, GB_VAT, GE_VAT, + GN_NIF, HK_BR, + HR_OIB, HU_TIN, ID_NPWP, IL_VAT, @@ -1104,9 +1445,18 @@ private constructor( JP_RN, JP_TRN, KE_PIN, + KG_TIN, + KH_TIN, KR_BRN, KZ_BIN, + LA_TIN, LI_UID, + LI_VAT, + MA_VAT, + MD_VAT, + ME_PIB, + MK_VAT, + MR_NIF, MX_RFC, MY_FRP, MY_ITN, @@ -1114,6 +1464,7 @@ private constructor( NG_TIN, NO_VAT, NO_VOEC, + NP_PAN, NZ_GST, OM_VAT, PE_RUC, @@ -1126,16 +1477,25 @@ private constructor( SG_GST, SG_UEN, SI_TIN, + SN_NINEA, + SR_FIN, SV_NIT, TH_VAT, + TJ_TIN, TR_TIN, TW_VAT, + TZ_VAT, UA_VAT, + UG_TIN, US_EIN, UY_RUC, + UZ_TIN, + UZ_VAT, VE_RIF, VN_TIN, ZA_VAT, + ZM_TIN, + ZW_TIN, } /** @@ -1150,34 +1510,54 @@ private constructor( enum class Value { AD_NRT, AE_TRN, + AL_TIN, + AM_TIN, + AO_TIN, AR_CUIT, EU_VAT, AU_ABN, AU_ARN, + AW_TIN, + AZ_TIN, + BA_TIN, + BB_TIN, + BD_BIN, + BF_IFU, BG_UIC, BH_VAT, + BJ_IFU, BO_TIN, BR_CNPJ, BR_CPF, + BS_TIN, + BY_TIN, CA_BN, CA_GST_HST, CA_PST_BC, CA_PST_MB, CA_PST_SK, CA_QST, + CD_NIF, + CH_UID, CH_VAT, CL_TIN, + CM_NIU, CN_TIN, CO_NIT, CR_TIN, + CV_NIF, + DE_STN, DO_RCN, EC_RUC, EG_TIN, ES_CIF, + ET_TIN, EU_OSS_VAT, GB_VAT, GE_VAT, + GN_NIF, HK_BR, + HR_OIB, HU_TIN, ID_NPWP, IL_VAT, @@ -1187,9 +1567,18 @@ private constructor( JP_RN, JP_TRN, KE_PIN, + KG_TIN, + KH_TIN, KR_BRN, KZ_BIN, + LA_TIN, LI_UID, + LI_VAT, + MA_VAT, + MD_VAT, + ME_PIB, + MK_VAT, + MR_NIF, MX_RFC, MY_FRP, MY_ITN, @@ -1197,6 +1586,7 @@ private constructor( NG_TIN, NO_VAT, NO_VOEC, + NP_PAN, NZ_GST, OM_VAT, PE_RUC, @@ -1209,16 +1599,25 @@ private constructor( SG_GST, SG_UEN, SI_TIN, + SN_NINEA, + SR_FIN, SV_NIT, TH_VAT, + TJ_TIN, TR_TIN, TW_VAT, + TZ_VAT, UA_VAT, + UG_TIN, US_EIN, UY_RUC, + UZ_TIN, + UZ_VAT, VE_RIF, VN_TIN, ZA_VAT, + ZM_TIN, + ZW_TIN, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1234,34 +1633,54 @@ private constructor( when (this) { AD_NRT -> Value.AD_NRT AE_TRN -> Value.AE_TRN + AL_TIN -> Value.AL_TIN + AM_TIN -> Value.AM_TIN + AO_TIN -> Value.AO_TIN AR_CUIT -> Value.AR_CUIT EU_VAT -> Value.EU_VAT AU_ABN -> Value.AU_ABN AU_ARN -> Value.AU_ARN + AW_TIN -> Value.AW_TIN + AZ_TIN -> Value.AZ_TIN + BA_TIN -> Value.BA_TIN + BB_TIN -> Value.BB_TIN + BD_BIN -> Value.BD_BIN + BF_IFU -> Value.BF_IFU BG_UIC -> Value.BG_UIC BH_VAT -> Value.BH_VAT + BJ_IFU -> Value.BJ_IFU BO_TIN -> Value.BO_TIN BR_CNPJ -> Value.BR_CNPJ BR_CPF -> Value.BR_CPF + BS_TIN -> Value.BS_TIN + BY_TIN -> Value.BY_TIN CA_BN -> Value.CA_BN CA_GST_HST -> Value.CA_GST_HST CA_PST_BC -> Value.CA_PST_BC CA_PST_MB -> Value.CA_PST_MB CA_PST_SK -> Value.CA_PST_SK CA_QST -> Value.CA_QST + CD_NIF -> Value.CD_NIF + CH_UID -> Value.CH_UID CH_VAT -> Value.CH_VAT CL_TIN -> Value.CL_TIN + CM_NIU -> Value.CM_NIU CN_TIN -> Value.CN_TIN CO_NIT -> Value.CO_NIT CR_TIN -> Value.CR_TIN + CV_NIF -> Value.CV_NIF + DE_STN -> Value.DE_STN DO_RCN -> Value.DO_RCN EC_RUC -> Value.EC_RUC EG_TIN -> Value.EG_TIN ES_CIF -> Value.ES_CIF + ET_TIN -> Value.ET_TIN EU_OSS_VAT -> Value.EU_OSS_VAT GB_VAT -> Value.GB_VAT GE_VAT -> Value.GE_VAT + GN_NIF -> Value.GN_NIF HK_BR -> Value.HK_BR + HR_OIB -> Value.HR_OIB HU_TIN -> Value.HU_TIN ID_NPWP -> Value.ID_NPWP IL_VAT -> Value.IL_VAT @@ -1271,9 +1690,18 @@ private constructor( JP_RN -> Value.JP_RN JP_TRN -> Value.JP_TRN KE_PIN -> Value.KE_PIN + KG_TIN -> Value.KG_TIN + KH_TIN -> Value.KH_TIN KR_BRN -> Value.KR_BRN KZ_BIN -> Value.KZ_BIN + LA_TIN -> Value.LA_TIN LI_UID -> Value.LI_UID + LI_VAT -> Value.LI_VAT + MA_VAT -> Value.MA_VAT + MD_VAT -> Value.MD_VAT + ME_PIB -> Value.ME_PIB + MK_VAT -> Value.MK_VAT + MR_NIF -> Value.MR_NIF MX_RFC -> Value.MX_RFC MY_FRP -> Value.MY_FRP MY_ITN -> Value.MY_ITN @@ -1281,6 +1709,7 @@ private constructor( NG_TIN -> Value.NG_TIN NO_VAT -> Value.NO_VAT NO_VOEC -> Value.NO_VOEC + NP_PAN -> Value.NP_PAN NZ_GST -> Value.NZ_GST OM_VAT -> Value.OM_VAT PE_RUC -> Value.PE_RUC @@ -1293,16 +1722,25 @@ private constructor( SG_GST -> Value.SG_GST SG_UEN -> Value.SG_UEN SI_TIN -> Value.SI_TIN + SN_NINEA -> Value.SN_NINEA + SR_FIN -> Value.SR_FIN SV_NIT -> Value.SV_NIT TH_VAT -> Value.TH_VAT + TJ_TIN -> Value.TJ_TIN TR_TIN -> Value.TR_TIN TW_VAT -> Value.TW_VAT + TZ_VAT -> Value.TZ_VAT UA_VAT -> Value.UA_VAT + UG_TIN -> Value.UG_TIN US_EIN -> Value.US_EIN UY_RUC -> Value.UY_RUC + UZ_TIN -> Value.UZ_TIN + UZ_VAT -> Value.UZ_VAT VE_RIF -> Value.VE_RIF VN_TIN -> Value.VN_TIN ZA_VAT -> Value.ZA_VAT + ZM_TIN -> Value.ZM_TIN + ZW_TIN -> Value.ZW_TIN else -> Value._UNKNOWN } @@ -1318,34 +1756,54 @@ private constructor( when (this) { AD_NRT -> Known.AD_NRT AE_TRN -> Known.AE_TRN + AL_TIN -> Known.AL_TIN + AM_TIN -> Known.AM_TIN + AO_TIN -> Known.AO_TIN AR_CUIT -> Known.AR_CUIT EU_VAT -> Known.EU_VAT AU_ABN -> Known.AU_ABN AU_ARN -> Known.AU_ARN + AW_TIN -> Known.AW_TIN + AZ_TIN -> Known.AZ_TIN + BA_TIN -> Known.BA_TIN + BB_TIN -> Known.BB_TIN + BD_BIN -> Known.BD_BIN + BF_IFU -> Known.BF_IFU BG_UIC -> Known.BG_UIC BH_VAT -> Known.BH_VAT + BJ_IFU -> Known.BJ_IFU BO_TIN -> Known.BO_TIN BR_CNPJ -> Known.BR_CNPJ BR_CPF -> Known.BR_CPF + BS_TIN -> Known.BS_TIN + BY_TIN -> Known.BY_TIN CA_BN -> Known.CA_BN CA_GST_HST -> Known.CA_GST_HST CA_PST_BC -> Known.CA_PST_BC CA_PST_MB -> Known.CA_PST_MB CA_PST_SK -> Known.CA_PST_SK CA_QST -> Known.CA_QST + CD_NIF -> Known.CD_NIF + CH_UID -> Known.CH_UID CH_VAT -> Known.CH_VAT CL_TIN -> Known.CL_TIN + CM_NIU -> Known.CM_NIU CN_TIN -> Known.CN_TIN CO_NIT -> Known.CO_NIT CR_TIN -> Known.CR_TIN + CV_NIF -> Known.CV_NIF + DE_STN -> Known.DE_STN DO_RCN -> Known.DO_RCN EC_RUC -> Known.EC_RUC EG_TIN -> Known.EG_TIN ES_CIF -> Known.ES_CIF + ET_TIN -> Known.ET_TIN EU_OSS_VAT -> Known.EU_OSS_VAT GB_VAT -> Known.GB_VAT GE_VAT -> Known.GE_VAT + GN_NIF -> Known.GN_NIF HK_BR -> Known.HK_BR + HR_OIB -> Known.HR_OIB HU_TIN -> Known.HU_TIN ID_NPWP -> Known.ID_NPWP IL_VAT -> Known.IL_VAT @@ -1355,9 +1813,18 @@ private constructor( JP_RN -> Known.JP_RN JP_TRN -> Known.JP_TRN KE_PIN -> Known.KE_PIN + KG_TIN -> Known.KG_TIN + KH_TIN -> Known.KH_TIN KR_BRN -> Known.KR_BRN KZ_BIN -> Known.KZ_BIN + LA_TIN -> Known.LA_TIN LI_UID -> Known.LI_UID + LI_VAT -> Known.LI_VAT + MA_VAT -> Known.MA_VAT + MD_VAT -> Known.MD_VAT + ME_PIB -> Known.ME_PIB + MK_VAT -> Known.MK_VAT + MR_NIF -> Known.MR_NIF MX_RFC -> Known.MX_RFC MY_FRP -> Known.MY_FRP MY_ITN -> Known.MY_ITN @@ -1365,6 +1832,7 @@ private constructor( NG_TIN -> Known.NG_TIN NO_VAT -> Known.NO_VAT NO_VOEC -> Known.NO_VOEC + NP_PAN -> Known.NP_PAN NZ_GST -> Known.NZ_GST OM_VAT -> Known.OM_VAT PE_RUC -> Known.PE_RUC @@ -1377,16 +1845,25 @@ private constructor( SG_GST -> Known.SG_GST SG_UEN -> Known.SG_UEN SI_TIN -> Known.SI_TIN + SN_NINEA -> Known.SN_NINEA + SR_FIN -> Known.SR_FIN SV_NIT -> Known.SV_NIT TH_VAT -> Known.TH_VAT + TJ_TIN -> Known.TJ_TIN TR_TIN -> Known.TR_TIN TW_VAT -> Known.TW_VAT + TZ_VAT -> Known.TZ_VAT UA_VAT -> Known.UA_VAT + UG_TIN -> Known.UG_TIN US_EIN -> Known.US_EIN UY_RUC -> Known.UY_RUC + UZ_TIN -> Known.UZ_TIN + UZ_VAT -> Known.UZ_VAT VE_RIF -> Known.VE_RIF VN_TIN -> Known.VN_TIN ZA_VAT -> Known.ZA_VAT + ZM_TIN -> Known.ZM_TIN + ZW_TIN -> Known.ZW_TIN else -> throw OrbInvalidDataException("Unknown Type: $value") } 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 2552796c..657c7943 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 @@ -184,106 +184,145 @@ private constructor( * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -880,106 +919,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = apply { body.taxId(taxId) } @@ -1374,106 +1452,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -2122,106 +2239,145 @@ private constructor( * to the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = taxId(JsonField.ofNullable(taxId)) 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 00713032..8f603ade 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 @@ -185,106 +185,145 @@ private constructor( * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -876,106 +915,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = apply { body.taxId(taxId) } @@ -1370,106 +1448,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -2118,106 +2235,145 @@ private constructor( * to the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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 taxId(taxId: CustomerTaxId?) = taxId(JsonField.ofNullable(taxId)) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.kt new file mode 100644 index 00000000..1e1f645b --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.kt @@ -0,0 +1,677 @@ +// 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.core.toImmutable +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 can be used to update the `external_dimensional_price_group_id` and `metadata` of + * an existing dimensional price group. Other fields on a dimensional price group are currently + * immutable. + */ +class DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams +private constructor( + private val pathExternalDimensionalPriceGroupId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun pathExternalDimensionalPriceGroupId(): Optional = + Optional.ofNullable(pathExternalDimensionalPriceGroupId) + + /** + * An optional user-defined ID for this dimensional price group resource, used throughout the + * system as an alias for this dimensional price group. Use this field to identify a dimensional + * price group by an existing identifier in your system. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun bodyExternalDimensionalPriceGroupId(): Optional = + body.bodyExternalDimensionalPriceGroupId() + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by setting + * the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun metadata(): Optional = body.metadata() + + /** + * Returns the raw JSON value of [bodyExternalDimensionalPriceGroupId]. + * + * Unlike [bodyExternalDimensionalPriceGroupId], this method doesn't throw if the JSON field has + * an unexpected type. + */ + fun _bodyExternalDimensionalPriceGroupId(): JsonField = + body._bodyExternalDimensionalPriceGroupId() + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _metadata(): JsonField = body._metadata() + + 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(): DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams]. */ + class Builder internal constructor() { + + private var pathExternalDimensionalPriceGroupId: 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( + dimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams: + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + ) = apply { + pathExternalDimensionalPriceGroupId = + dimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + .pathExternalDimensionalPriceGroupId + body = dimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.body.toBuilder() + additionalHeaders = + dimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.additionalHeaders + .toBuilder() + additionalQueryParams = + dimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + .additionalQueryParams + .toBuilder() + } + + fun pathExternalDimensionalPriceGroupId(pathExternalDimensionalPriceGroupId: String?) = + apply { + this.pathExternalDimensionalPriceGroupId = pathExternalDimensionalPriceGroupId + } + + /** + * Alias for calling [Builder.pathExternalDimensionalPriceGroupId] with + * `pathExternalDimensionalPriceGroupId.orElse(null)`. + */ + fun pathExternalDimensionalPriceGroupId( + pathExternalDimensionalPriceGroupId: Optional + ) = pathExternalDimensionalPriceGroupId(pathExternalDimensionalPriceGroupId.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: + * - [bodyExternalDimensionalPriceGroupId] + * - [metadata] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * An optional user-defined ID for this dimensional price group resource, used throughout + * the system as an alias for this dimensional price group. Use this field to identify a + * dimensional price group by an existing identifier in your system. + */ + fun bodyExternalDimensionalPriceGroupId(bodyExternalDimensionalPriceGroupId: String?) = + apply { + body.bodyExternalDimensionalPriceGroupId(bodyExternalDimensionalPriceGroupId) + } + + /** + * Alias for calling [Builder.bodyExternalDimensionalPriceGroupId] with + * `bodyExternalDimensionalPriceGroupId.orElse(null)`. + */ + fun bodyExternalDimensionalPriceGroupId( + bodyExternalDimensionalPriceGroupId: Optional + ) = bodyExternalDimensionalPriceGroupId(bodyExternalDimensionalPriceGroupId.getOrNull()) + + /** + * Sets [Builder.bodyExternalDimensionalPriceGroupId] to an arbitrary JSON value. + * + * You should usually call [Builder.bodyExternalDimensionalPriceGroupId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun bodyExternalDimensionalPriceGroupId( + bodyExternalDimensionalPriceGroupId: JsonField + ) = apply { body.bodyExternalDimensionalPriceGroupId(bodyExternalDimensionalPriceGroupId) } + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by + * setting the value to `null`, and the entire metadata mapping can be cleared by setting + * `metadata` to `null`. + */ + fun metadata(metadata: Metadata?) = apply { body.metadata(metadata) } + + /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) + + /** + * 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 { body.metadata(metadata) } + + 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 + * [DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams( + pathExternalDimensionalPriceGroupId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> pathExternalDimensionalPriceGroupId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + private constructor( + private val bodyExternalDimensionalPriceGroupId: JsonField, + private val metadata: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("external_dimensional_price_group_id") + @ExcludeMissing + bodyExternalDimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + ) : this(bodyExternalDimensionalPriceGroupId, metadata, mutableMapOf()) + + /** + * An optional user-defined ID for this dimensional price group resource, used throughout + * the system as an alias for this dimensional price group. Use this field to identify a + * dimensional price group by an existing identifier in your system. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun bodyExternalDimensionalPriceGroupId(): Optional = + bodyExternalDimensionalPriceGroupId.getOptional("external_dimensional_price_group_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 `null`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metadata(): Optional = metadata.getOptional("metadata") + + /** + * Returns the raw JSON value of [bodyExternalDimensionalPriceGroupId]. + * + * Unlike [bodyExternalDimensionalPriceGroupId], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("external_dimensional_price_group_id") + @ExcludeMissing + fun _bodyExternalDimensionalPriceGroupId(): JsonField = + bodyExternalDimensionalPriceGroupId + + /** + * 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 + + @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 bodyExternalDimensionalPriceGroupId: JsonField = JsonMissing.of() + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + bodyExternalDimensionalPriceGroupId = body.bodyExternalDimensionalPriceGroupId + metadata = body.metadata + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * An optional user-defined ID for this dimensional price group resource, used + * throughout the system as an alias for this dimensional price group. Use this field to + * identify a dimensional price group by an existing identifier in your system. + */ + fun bodyExternalDimensionalPriceGroupId(bodyExternalDimensionalPriceGroupId: String?) = + bodyExternalDimensionalPriceGroupId( + JsonField.ofNullable(bodyExternalDimensionalPriceGroupId) + ) + + /** + * Alias for calling [Builder.bodyExternalDimensionalPriceGroupId] with + * `bodyExternalDimensionalPriceGroupId.orElse(null)`. + */ + fun bodyExternalDimensionalPriceGroupId( + bodyExternalDimensionalPriceGroupId: Optional + ) = bodyExternalDimensionalPriceGroupId(bodyExternalDimensionalPriceGroupId.getOrNull()) + + /** + * Sets [Builder.bodyExternalDimensionalPriceGroupId] to an arbitrary JSON value. + * + * You should usually call [Builder.bodyExternalDimensionalPriceGroupId] with a + * well-typed [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun bodyExternalDimensionalPriceGroupId( + bodyExternalDimensionalPriceGroupId: JsonField + ) = apply { + this.bodyExternalDimensionalPriceGroupId = bodyExternalDimensionalPriceGroupId + } + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by + * setting the value to `null`, and the entire metadata mapping can be cleared by + * setting `metadata` to `null`. + */ + fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata)) + + /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) + + /** + * 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 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( + bodyExternalDimensionalPriceGroupId, + metadata, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + bodyExternalDimensionalPriceGroupId() + metadata().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 (bodyExternalDimensionalPriceGroupId.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Body && bodyExternalDimensionalPriceGroupId == other.bodyExternalDimensionalPriceGroupId && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(bodyExternalDimensionalPriceGroupId, metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{bodyExternalDimensionalPriceGroupId=$bodyExternalDimensionalPriceGroupId, metadata=$metadata, additionalProperties=$additionalProperties}" + } + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by setting + * the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + 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 /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams && pathExternalDimensionalPriceGroupId == other.pathExternalDimensionalPriceGroupId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(pathExternalDimensionalPriceGroupId, body, additionalHeaders, additionalQueryParams) /* spotless:on */ + + override fun toString() = + "DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams{pathExternalDimensionalPriceGroupId=$pathExternalDimensionalPriceGroupId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupUpdateParams.kt new file mode 100644 index 00000000..e34c4b41 --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupUpdateParams.kt @@ -0,0 +1,653 @@ +// 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.core.toImmutable +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 can be used to update the `external_dimensional_price_group_id` and `metadata` of + * an existing dimensional price group. Other fields on a dimensional price group are currently + * immutable. + */ +class DimensionalPriceGroupUpdateParams +private constructor( + private val dimensionalPriceGroupId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun dimensionalPriceGroupId(): Optional = Optional.ofNullable(dimensionalPriceGroupId) + + /** + * An optional user-defined ID for this dimensional price group resource, used throughout the + * system as an alias for this dimensional price group. Use this field to identify a dimensional + * price group by an existing identifier in your system. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun externalDimensionalPriceGroupId(): Optional = body.externalDimensionalPriceGroupId() + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by setting + * the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server + * responded with an unexpected value). + */ + fun metadata(): Optional = body.metadata() + + /** + * Returns the raw JSON value of [externalDimensionalPriceGroupId]. + * + * Unlike [externalDimensionalPriceGroupId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _externalDimensionalPriceGroupId(): JsonField = + body._externalDimensionalPriceGroupId() + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _metadata(): JsonField = body._metadata() + + 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(): DimensionalPriceGroupUpdateParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [DimensionalPriceGroupUpdateParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceGroupUpdateParams]. */ + class Builder internal constructor() { + + private var dimensionalPriceGroupId: 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(dimensionalPriceGroupUpdateParams: DimensionalPriceGroupUpdateParams) = + apply { + dimensionalPriceGroupId = dimensionalPriceGroupUpdateParams.dimensionalPriceGroupId + body = dimensionalPriceGroupUpdateParams.body.toBuilder() + additionalHeaders = dimensionalPriceGroupUpdateParams.additionalHeaders.toBuilder() + additionalQueryParams = + dimensionalPriceGroupUpdateParams.additionalQueryParams.toBuilder() + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String?) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + /** + * Alias for calling [Builder.dimensionalPriceGroupId] with + * `dimensionalPriceGroupId.orElse(null)`. + */ + fun dimensionalPriceGroupId(dimensionalPriceGroupId: Optional) = + dimensionalPriceGroupId(dimensionalPriceGroupId.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: + * - [externalDimensionalPriceGroupId] + * - [metadata] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * An optional user-defined ID for this dimensional price group resource, used throughout + * the system as an alias for this dimensional price group. Use this field to identify a + * dimensional price group by an existing identifier in your system. + */ + fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: String?) = apply { + body.externalDimensionalPriceGroupId(externalDimensionalPriceGroupId) + } + + /** + * Alias for calling [Builder.externalDimensionalPriceGroupId] with + * `externalDimensionalPriceGroupId.orElse(null)`. + */ + fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: Optional) = + externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.getOrNull()) + + /** + * Sets [Builder.externalDimensionalPriceGroupId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalDimensionalPriceGroupId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: JsonField) = + apply { + body.externalDimensionalPriceGroupId(externalDimensionalPriceGroupId) + } + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by + * setting the value to `null`, and the entire metadata mapping can be cleared by setting + * `metadata` to `null`. + */ + fun metadata(metadata: Metadata?) = apply { body.metadata(metadata) } + + /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) + + /** + * 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 { body.metadata(metadata) } + + 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 [DimensionalPriceGroupUpdateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): DimensionalPriceGroupUpdateParams = + DimensionalPriceGroupUpdateParams( + dimensionalPriceGroupId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> dimensionalPriceGroupId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + private constructor( + private val externalDimensionalPriceGroupId: JsonField, + private val metadata: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("external_dimensional_price_group_id") + @ExcludeMissing + externalDimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + ) : this(externalDimensionalPriceGroupId, metadata, mutableMapOf()) + + /** + * An optional user-defined ID for this dimensional price group resource, used throughout + * the system as an alias for this dimensional price group. Use this field to identify a + * dimensional price group by an existing identifier in your system. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalDimensionalPriceGroupId(): Optional = + externalDimensionalPriceGroupId.getOptional("external_dimensional_price_group_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 `null`. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metadata(): Optional = metadata.getOptional("metadata") + + /** + * Returns the raw JSON value of [externalDimensionalPriceGroupId]. + * + * Unlike [externalDimensionalPriceGroupId], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("external_dimensional_price_group_id") + @ExcludeMissing + fun _externalDimensionalPriceGroupId(): JsonField = externalDimensionalPriceGroupId + + /** + * 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 + + @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 externalDimensionalPriceGroupId: JsonField = JsonMissing.of() + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + externalDimensionalPriceGroupId = body.externalDimensionalPriceGroupId + metadata = body.metadata + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * An optional user-defined ID for this dimensional price group resource, used + * throughout the system as an alias for this dimensional price group. Use this field to + * identify a dimensional price group by an existing identifier in your system. + */ + fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: String?) = + externalDimensionalPriceGroupId( + JsonField.ofNullable(externalDimensionalPriceGroupId) + ) + + /** + * Alias for calling [Builder.externalDimensionalPriceGroupId] with + * `externalDimensionalPriceGroupId.orElse(null)`. + */ + fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: Optional) = + externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.getOrNull()) + + /** + * Sets [Builder.externalDimensionalPriceGroupId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalDimensionalPriceGroupId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun externalDimensionalPriceGroupId( + externalDimensionalPriceGroupId: JsonField + ) = apply { this.externalDimensionalPriceGroupId = externalDimensionalPriceGroupId } + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by + * setting the value to `null`, and the entire metadata mapping can be cleared by + * setting `metadata` to `null`. + */ + fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata)) + + /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) + + /** + * 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 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(externalDimensionalPriceGroupId, metadata, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + externalDimensionalPriceGroupId() + metadata().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 (externalDimensionalPriceGroupId.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Body && externalDimensionalPriceGroupId == other.externalDimensionalPriceGroupId && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(externalDimensionalPriceGroupId, metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{externalDimensionalPriceGroupId=$externalDimensionalPriceGroupId, metadata=$metadata, additionalProperties=$additionalProperties}" + } + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed by setting + * the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + 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 /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceGroupUpdateParams && dimensionalPriceGroupId == other.dimensionalPriceGroupId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(dimensionalPriceGroupId, body, additionalHeaders, additionalQueryParams) /* spotless:on */ + + override fun toString() = + "DimensionalPriceGroupUpdateParams{dimensionalPriceGroupId=$dimensionalPriceGroupId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} 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 7ccfc99d..cc1daefd 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 @@ -301,106 +301,145 @@ private constructor( * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -1305,106 +1344,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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)) @@ -5053,6 +5131,13 @@ private constructor( fun price(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = price(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [price] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun price(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + price(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + /** Either the fixed fee quantity or the usage during the service period. */ fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) 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 7c33d0ac..e7f672f9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt @@ -294,106 +294,145 @@ private constructor( * headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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). @@ -1299,106 +1338,145 @@ private constructor( * the headers of invoices. * * ### Supported Tax ID Countries and Types - * |Country |Type |Description | - * |--------------------|------------|-------------------------------------------------------------------------------------------------------| - * |Andorra |`ad_nrt` |Andorran NRT Number | - * |Argentina |`ar_cuit` |Argentinian Tax ID Number | - * |Australia |`au_abn` |Australian Business Number (AU ABN) | - * |Australia |`au_arn` |Australian Taxation Office Reference Number | - * |Austria |`eu_vat` |European VAT Number | - * |Bahrain |`bh_vat` |Bahraini VAT Number | - * |Belgium |`eu_vat` |European VAT Number | - * |Bolivia |`bo_tin` |Bolivian Tax ID | - * |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 | - * |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) | - * |Chile |`cl_tin` |Chilean TIN | - * |China |`cn_tin` |Chinese Tax ID | - * |Colombia |`co_nit` |Colombian NIT Number | - * |Costa Rica |`cr_tin` |Costa Rican Tax ID | - * |Croatia |`eu_vat` |European VAT Number | - * |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 | - * |EU |`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 |`eu_vat` |European VAT Number | - * |Greece |`eu_vat` |European VAT Number | - * |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 | - * |Latvia |`eu_vat` |European VAT Number | - * |Liechtenstein |`li_uid` |Liechtensteinian UID 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 | - * |Mexico |`mx_rfc` |Mexican RFC Number | - * |Netherlands |`eu_vat` |European VAT Number | - * |New Zealand |`nz_gst` |New Zealand GST Number | - * |Nigeria |`ng_tin` |Nigerian Tax Identification 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 | - * |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 | - * |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 | - * |Sweden |`eu_vat` |European VAT Number | - * |Switzerland |`ch_vat` |Switzerland VAT Number | - * |Taiwan |`tw_vat` |Taiwanese VAT | - * |Thailand |`th_vat` |Thai VAT | - * |Turkey |`tr_tin` |Turkish Tax Identification Number | - * |Ukraine |`ua_vat` |Ukrainian VAT | - * |United Arab Emirates|`ae_trn` |United Arab Emirates TRN | - * |United Kingdom |`eu_vat` |Northern Ireland VAT Number | - * |United Kingdom |`gb_vat` |United Kingdom VAT Number | - * |United States |`us_ein` |United States EIN | - * |Uruguay |`uy_ruc` |Uruguayan RUC Number | - * |Venezuela |`ve_rif` |Venezuelan RIF Number | - * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | + * |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 | + * |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)) @@ -5047,6 +5125,13 @@ private constructor( fun price(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = price(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [price] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun price(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + price(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + /** Either the fixed fee quantity or the usage during the service period. */ fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt index 89e6b926..f226b181 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt @@ -1108,6 +1108,13 @@ private constructor( fun price(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = price(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [price] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun price(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + price(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + /** Either the fixed fee quantity or the usage during the service period. */ fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PerPriceCost.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PerPriceCost.kt index 49596e32..8794114c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PerPriceCost.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PerPriceCost.kt @@ -295,6 +295,13 @@ private constructor( fun price(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = price(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [price] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun price(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + price(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + /** The price the cost is associated with */ fun priceId(priceId: String) = priceId(JsonField.of(priceId)) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt index 9a32bf22..562bf2a8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt @@ -1223,6 +1223,13 @@ private constructor( fun addPrice(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = addPrice(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [addPrice] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun addPrice(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + addPrice(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + fun product(product: Product) = product(JsonField.of(product)) /** diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanVersion.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanVersion.kt index 7006e244..83256ef3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanVersion.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanVersion.kt @@ -440,6 +440,13 @@ private constructor( fun addPrice(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = addPrice(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [addPrice] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun addPrice(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + addPrice(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + fun version(version: Long) = version(JsonField.of(version)) /** 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 9556b497..53b0af8a 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 @@ -75,6 +75,7 @@ private constructor( private val scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing? = null, private val scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing? = null, private val cumulativeGroupedBulk: CumulativeGroupedBulk? = null, + private val groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds? = null, private val _json: JsonValue? = null, ) { @@ -147,6 +148,9 @@ private constructor( fun cumulativeGroupedBulk(): Optional = Optional.ofNullable(cumulativeGroupedBulk) + fun groupedWithMinMaxThresholds(): Optional = + Optional.ofNullable(groupedWithMinMaxThresholds) + fun isUnit(): Boolean = unit != null fun isPackage(): Boolean = package_ != null @@ -203,6 +207,8 @@ private constructor( fun isCumulativeGroupedBulk(): Boolean = cumulativeGroupedBulk != null + fun isGroupedWithMinMaxThresholds(): Boolean = groupedWithMinMaxThresholds != null + fun asUnit(): Unit = unit.getOrThrow("unit") fun asPackage(): Package = package_.getOrThrow("package_") @@ -272,6 +278,9 @@ private constructor( fun asCumulativeGroupedBulk(): CumulativeGroupedBulk = cumulativeGroupedBulk.getOrThrow("cumulativeGroupedBulk") + fun asGroupedWithMinMaxThresholds(): GroupedWithMinMaxThresholds = + groupedWithMinMaxThresholds.getOrThrow("groupedWithMinMaxThresholds") + fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T = @@ -313,6 +322,8 @@ private constructor( visitor.visitScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing) cumulativeGroupedBulk != null -> visitor.visitCumulativeGroupedBulk(cumulativeGroupedBulk) + groupedWithMinMaxThresholds != null -> + visitor.visitGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds) else -> visitor.unknown(_json) } @@ -454,6 +465,12 @@ private constructor( ) { cumulativeGroupedBulk.validate() } + + override fun visitGroupedWithMinMaxThresholds( + groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds + ) { + groupedWithMinMaxThresholds.validate() + } } ) validated = true @@ -561,6 +578,10 @@ private constructor( cumulativeGroupedBulk: CumulativeGroupedBulk ) = cumulativeGroupedBulk.validity() + override fun visitGroupedWithMinMaxThresholds( + groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds + ) = groupedWithMinMaxThresholds.validity() + override fun unknown(json: JsonValue?) = 0 } ) @@ -570,10 +591,10 @@ private constructor( return true } - return /* spotless:off */ other is Price && unit == other.unit && package_ == other.package_ && matrix == other.matrix && tiered == other.tiered && tieredBps == other.tieredBps && bps == other.bps && bulkBps == other.bulkBps && bulk == other.bulk && thresholdTotalAmount == other.thresholdTotalAmount && tieredPackage == other.tieredPackage && groupedTiered == other.groupedTiered && tieredWithMinimum == other.tieredWithMinimum && tieredPackageWithMinimum == other.tieredPackageWithMinimum && packageWithAllocation == other.packageWithAllocation && unitWithPercent == other.unitWithPercent && matrixWithAllocation == other.matrixWithAllocation && tieredWithProration == other.tieredWithProration && unitWithProration == other.unitWithProration && groupedAllocation == other.groupedAllocation && groupedWithProratedMinimum == other.groupedWithProratedMinimum && groupedWithMeteredMinimum == other.groupedWithMeteredMinimum && matrixWithDisplayName == other.matrixWithDisplayName && bulkWithProration == other.bulkWithProration && groupedTieredPackage == other.groupedTieredPackage && maxGroupTieredPackage == other.maxGroupTieredPackage && scalableMatrixWithUnitPricing == other.scalableMatrixWithUnitPricing && scalableMatrixWithTieredPricing == other.scalableMatrixWithTieredPricing && cumulativeGroupedBulk == other.cumulativeGroupedBulk /* spotless:on */ + return /* spotless:off */ other is Price && unit == other.unit && package_ == other.package_ && matrix == other.matrix && tiered == other.tiered && tieredBps == other.tieredBps && bps == other.bps && bulkBps == other.bulkBps && bulk == other.bulk && thresholdTotalAmount == other.thresholdTotalAmount && tieredPackage == other.tieredPackage && groupedTiered == other.groupedTiered && tieredWithMinimum == other.tieredWithMinimum && tieredPackageWithMinimum == other.tieredPackageWithMinimum && packageWithAllocation == other.packageWithAllocation && unitWithPercent == other.unitWithPercent && matrixWithAllocation == other.matrixWithAllocation && tieredWithProration == other.tieredWithProration && unitWithProration == other.unitWithProration && groupedAllocation == other.groupedAllocation && groupedWithProratedMinimum == other.groupedWithProratedMinimum && groupedWithMeteredMinimum == other.groupedWithMeteredMinimum && matrixWithDisplayName == other.matrixWithDisplayName && bulkWithProration == other.bulkWithProration && groupedTieredPackage == other.groupedTieredPackage && maxGroupTieredPackage == other.maxGroupTieredPackage && scalableMatrixWithUnitPricing == other.scalableMatrixWithUnitPricing && scalableMatrixWithTieredPricing == other.scalableMatrixWithTieredPricing && cumulativeGroupedBulk == other.cumulativeGroupedBulk && groupedWithMinMaxThresholds == other.groupedWithMinMaxThresholds /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(unit, package_, matrix, tiered, tieredBps, bps, bulkBps, bulk, thresholdTotalAmount, tieredPackage, groupedTiered, tieredWithMinimum, tieredPackageWithMinimum, packageWithAllocation, unitWithPercent, matrixWithAllocation, tieredWithProration, unitWithProration, groupedAllocation, groupedWithProratedMinimum, groupedWithMeteredMinimum, matrixWithDisplayName, bulkWithProration, groupedTieredPackage, maxGroupTieredPackage, scalableMatrixWithUnitPricing, scalableMatrixWithTieredPricing, cumulativeGroupedBulk) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(unit, package_, matrix, tiered, tieredBps, bps, bulkBps, bulk, thresholdTotalAmount, tieredPackage, groupedTiered, tieredWithMinimum, tieredPackageWithMinimum, packageWithAllocation, unitWithPercent, matrixWithAllocation, tieredWithProration, unitWithProration, groupedAllocation, groupedWithProratedMinimum, groupedWithMeteredMinimum, matrixWithDisplayName, bulkWithProration, groupedTieredPackage, maxGroupTieredPackage, scalableMatrixWithUnitPricing, scalableMatrixWithTieredPricing, cumulativeGroupedBulk, groupedWithMinMaxThresholds) /* spotless:on */ override fun toString(): String = when { @@ -610,6 +631,8 @@ private constructor( scalableMatrixWithTieredPricing != null -> "Price{scalableMatrixWithTieredPricing=$scalableMatrixWithTieredPricing}" cumulativeGroupedBulk != null -> "Price{cumulativeGroupedBulk=$cumulativeGroupedBulk}" + groupedWithMinMaxThresholds != null -> + "Price{groupedWithMinMaxThresholds=$groupedWithMinMaxThresholds}" _json != null -> "Price{_unknown=$_json}" else -> throw IllegalStateException("Invalid Price") } @@ -711,6 +734,11 @@ private constructor( @JvmStatic fun ofCumulativeGroupedBulk(cumulativeGroupedBulk: CumulativeGroupedBulk) = Price(cumulativeGroupedBulk = cumulativeGroupedBulk) + + @JvmStatic + fun ofGroupedWithMinMaxThresholds( + groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds + ) = Price(groupedWithMinMaxThresholds = groupedWithMinMaxThresholds) } /** An interface that defines how to map each variant of [Price] to a value of type [T]. */ @@ -778,6 +806,10 @@ private constructor( fun visitCumulativeGroupedBulk(cumulativeGroupedBulk: CumulativeGroupedBulk): T + fun visitGroupedWithMinMaxThresholds( + groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds + ): T + /** * Maps an unknown variant of [Price] to a value of type [T]. * @@ -939,6 +971,11 @@ private constructor( Price(cumulativeGroupedBulk = it, _json = json) } ?: Price(_json = json) } + "grouped_with_min_max_thresholds" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Price(groupedWithMinMaxThresholds = it, _json = json) } + ?: Price(_json = json) + } } return Price(_json = json) @@ -994,6 +1031,8 @@ private constructor( generator.writeObject(value.scalableMatrixWithTieredPricing) value.cumulativeGroupedBulk != null -> generator.writeObject(value.cumulativeGroupedBulk) + value.groupedWithMinMaxThresholds != null -> + generator.writeObject(value.groupedWithMinMaxThresholds) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Price") } @@ -2110,7 +2149,1990 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("unit") + * JsonValue.from("unit") + * ``` + * + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelType(modelType: JsonValue) = apply { this.modelType = modelType } + + 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 planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** + * Alias for [Builder.planPhaseOrder]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) + + /** Alias for calling [Builder.planPhaseOrder] with `planPhaseOrder.orElse(null)`. */ + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.getOrNull()) + + /** + * Sets [Builder.planPhaseOrder] to an arbitrary JSON value. + * + * You should usually call [Builder.planPhaseOrder] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + fun priceType(priceType: PriceType) = priceType(JsonField.of(priceType)) + + /** + * Sets [Builder.priceType] to an arbitrary JSON value. + * + * You should usually call [Builder.priceType] with a well-typed [PriceType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + fun replacesPriceId(replacesPriceId: String?) = + replacesPriceId(JsonField.ofNullable(replacesPriceId)) + + /** Alias for calling [Builder.replacesPriceId] with `replacesPriceId.orElse(null)`. */ + fun replacesPriceId(replacesPriceId: Optional) = + replacesPriceId(replacesPriceId.getOrNull()) + + /** + * Sets [Builder.replacesPriceId] to an arbitrary JSON value. + * + * You should usually call [Builder.replacesPriceId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun replacesPriceId(replacesPriceId: JsonField) = apply { + this.replacesPriceId = replacesPriceId + } + + fun unitConfig(unitConfig: UnitConfig) = unitConfig(JsonField.of(unitConfig)) + + /** + * Sets [Builder.unitConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.unitConfig] with a well-typed [UnitConfig] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unitConfig(unitConfig: JsonField) = apply { + this.unitConfig = unitConfig + } + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + /** + * Alias for calling [Builder.dimensionalPriceConfiguration] with + * `dimensionalPriceConfiguration.orElse(null)`. + */ + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) + + /** + * Sets [Builder.dimensionalPriceConfiguration] to an arbitrary JSON value. + * + * You should usually call [Builder.dimensionalPriceConfiguration] with a well-typed + * [DimensionalPriceConfiguration] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Unit]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .billableMetric() + * .billingCycleConfiguration() + * .cadence() + * .conversionRate() + * .conversionRateConfig() + * .createdAt() + * .creditAllocation() + * .currency() + * .discount() + * .externalPriceId() + * .fixedPriceQuantity() + * .invoicingCycleConfiguration() + * .item() + * .maximum() + * .maximumAmount() + * .metadata() + * .minimum() + * .minimumAmount() + * .name() + * .planPhaseOrder() + * .priceType() + * .replacesPriceId() + * .unitConfig() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unit = + Unit( + checkRequired("id", id), + checkRequired("billableMetric", billableMetric), + checkRequired("billingCycleConfiguration", billingCycleConfiguration), + checkRequired("cadence", cadence), + checkRequired("conversionRate", conversionRate), + checkRequired("conversionRateConfig", conversionRateConfig), + checkRequired("createdAt", createdAt), + checkRequired("creditAllocation", creditAllocation), + checkRequired("currency", currency), + checkRequired("discount", discount), + checkRequired("externalPriceId", externalPriceId), + checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), + checkRequired("item", item), + checkRequired("maximum", maximum), + checkRequired("maximumAmount", maximumAmount), + checkRequired("metadata", metadata), + checkRequired("minimum", minimum), + checkRequired("minimumAmount", minimumAmount), + modelType, + checkRequired("name", name), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("priceType", priceType), + checkRequired("replacesPriceId", replacesPriceId), + checkRequired("unitConfig", unitConfig), + dimensionalPriceConfiguration, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unit = apply { + if (validated) { + return@apply + } + + id() + billableMetric().ifPresent { it.validate() } + billingCycleConfiguration().validate() + cadence().validate() + conversionRate() + conversionRateConfig().ifPresent { it.validate() } + createdAt() + creditAllocation().ifPresent { it.validate() } + currency() + discount().ifPresent { it.validate() } + externalPriceId() + fixedPriceQuantity() + invoicingCycleConfiguration().ifPresent { it.validate() } + item().validate() + maximum().ifPresent { it.validate() } + maximumAmount() + metadata().validate() + minimum().ifPresent { it.validate() } + minimumAmount() + _modelType().let { + if (it != JsonValue.from("unit")) { + throw OrbInvalidDataException("'modelType' is invalid, received $it") + } + } + name() + planPhaseOrder() + priceType().validate() + replacesPriceId() + unitConfig().validate() + dimensionalPriceConfiguration().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) + + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (cadence.asKnown().getOrNull()?.validity() ?: 0) + + (if (conversionRate.asKnown().isPresent) 1 else 0) + + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (creditAllocation.asKnown().getOrNull()?.validity() ?: 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + (discount.asKnown().getOrNull()?.validity() ?: 0) + + (if (externalPriceId.asKnown().isPresent) 1 else 0) + + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (item.asKnown().getOrNull()?.validity() ?: 0) + + (maximum.asKnown().getOrNull()?.validity() ?: 0) + + (if (maximumAmount.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (minimum.asKnown().getOrNull()?.validity() ?: 0) + + (if (minimumAmount.asKnown().isPresent) 1 else 0) + + modelType.let { if (it == JsonValue.from("unit")) 1 else 0 } + + (if (name.asKnown().isPresent) 1 else 0) + + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + + (priceType.asKnown().getOrNull()?.validity() ?: 0) + + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (unitConfig.asKnown().getOrNull()?.validity() ?: 0) + + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + class Cadence @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ONE_TIME = of("one_time") + + @JvmField val MONTHLY = of("monthly") + + @JvmField val QUARTERLY = of("quarterly") + + @JvmField val SEMI_ANNUAL = of("semi_annual") + + @JvmField val ANNUAL = of("annual") + + @JvmField val CUSTOM = of("custom") + + @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ONE_TIME -> Value.ONE_TIME + MONTHLY -> Value.MONTHLY + QUARTERLY -> Value.QUARTERLY + SEMI_ANNUAL -> Value.SEMI_ANNUAL + ANNUAL -> Value.ANNUAL + CUSTOM -> Value.CUSTOM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ONE_TIME -> Known.ONE_TIME + MONTHLY -> Known.MONTHLY + QUARTERLY -> Known.QUARTERLY + SEMI_ANNUAL -> Known.SEMI_ANNUAL + ANNUAL -> Known.ANNUAL + CUSTOM -> Known.CUSTOM + else -> throw OrbInvalidDataException("Unknown Cadence: $value") + } + + /** + * 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(): Cadence = 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 /* spotless:off */ other is Cadence && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(using = ConversionRateConfig.Deserializer::class) + @JsonSerialize(using = ConversionRateConfig.Serializer::class) + class ConversionRateConfig + private constructor( + private val unit: UnitConversionRateConfig? = null, + private val tiered: TieredConversionRateConfig? = null, + private val _json: JsonValue? = null, + ) { + + fun unit(): Optional = Optional.ofNullable(unit) + + fun tiered(): Optional = Optional.ofNullable(tiered) + + fun isUnit(): Boolean = unit != null + + fun isTiered(): Boolean = tiered != null + + fun asUnit(): UnitConversionRateConfig = unit.getOrThrow("unit") + + fun asTiered(): TieredConversionRateConfig = tiered.getOrThrow("tiered") + + fun _json(): Optional = Optional.ofNullable(_json) + + fun accept(visitor: Visitor): T = + when { + unit != null -> visitor.visitUnit(unit) + tiered != null -> visitor.visitTiered(tiered) + else -> visitor.unknown(_json) + } + + private var validated: Boolean = false + + fun validate(): ConversionRateConfig = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitUnit(unit: UnitConversionRateConfig) { + unit.validate() + } + + override fun visitTiered(tiered: TieredConversionRateConfig) { + tiered.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 = + accept( + object : Visitor { + override fun visitUnit(unit: UnitConversionRateConfig) = unit.validity() + + override fun visitTiered(tiered: TieredConversionRateConfig) = + tiered.validity() + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ConversionRateConfig && unit == other.unit && tiered == other.tiered /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(unit, tiered) /* spotless:on */ + + override fun toString(): String = + when { + unit != null -> "ConversionRateConfig{unit=$unit}" + tiered != null -> "ConversionRateConfig{tiered=$tiered}" + _json != null -> "ConversionRateConfig{_unknown=$_json}" + else -> throw IllegalStateException("Invalid ConversionRateConfig") + } + + companion object { + + @JvmStatic + fun ofUnit(unit: UnitConversionRateConfig) = ConversionRateConfig(unit = unit) + + @JvmStatic + fun ofTiered(tiered: TieredConversionRateConfig) = + ConversionRateConfig(tiered = tiered) + } + + /** + * An interface that defines how to map each variant of [ConversionRateConfig] to a + * value of type [T]. + */ + interface Visitor { + + fun visitUnit(unit: UnitConversionRateConfig): T + + fun visitTiered(tiered: TieredConversionRateConfig): T + + /** + * Maps an unknown variant of [ConversionRateConfig] to a value of type [T]. + * + * An instance of [ConversionRateConfig] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the + * SDK is on an older version than the API, then the API may respond with new + * variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw OrbInvalidDataException("Unknown ConversionRateConfig: $json") + } + } + + internal class Deserializer : + BaseDeserializer(ConversionRateConfig::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): ConversionRateConfig { + val json = JsonValue.fromJsonNode(node) + val conversionRateType = + json + .asObject() + .getOrNull() + ?.get("conversion_rate_type") + ?.asString() + ?.getOrNull() + + when (conversionRateType) { + "unit" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ConversionRateConfig(unit = it, _json = json) } + ?: ConversionRateConfig(_json = json) + } + "tiered" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ConversionRateConfig(tiered = it, _json = json) } + ?: ConversionRateConfig(_json = json) + } + } + + return ConversionRateConfig(_json = json) + } + } + + internal class Serializer : + BaseSerializer(ConversionRateConfig::class) { + + override fun serialize( + value: ConversionRateConfig, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.unit != null -> generator.writeObject(value.unit) + value.tiered != null -> generator.writeObject(value.tiered) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid ConversionRateConfig") + } + } + } + } + + /** + * 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 /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + + class PriceType @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val USAGE_PRICE = of("usage_price") + + @JvmField val FIXED_PRICE = of("fixed_price") + + @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + } + + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_PRICE, + FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_PRICE -> Value.USAGE_PRICE + FIXED_PRICE -> Value.FIXED_PRICE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + USAGE_PRICE -> Known.USAGE_PRICE + FIXED_PRICE -> Known.FIXED_PRICE + else -> throw OrbInvalidDataException("Unknown PriceType: $value") + } + + /** + * 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 /* spotless:off */ other is PriceType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Unit && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && unitConfig == other.unitConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, unitConfig, dimensionalPriceConfiguration, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unit{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + } + + class Package + private constructor( + private val id: JsonField, + private val billableMetric: JsonField, + private val billingCycleConfiguration: JsonField, + private val cadence: JsonField, + private val conversionRate: JsonField, + private val conversionRateConfig: JsonField, + private val createdAt: JsonField, + private val creditAllocation: JsonField, + private val currency: JsonField, + private val discount: JsonField, + private val externalPriceId: JsonField, + private val fixedPriceQuantity: JsonField, + private val invoicingCycleConfiguration: JsonField, + private val item: JsonField, + private val maximum: JsonField, + private val maximumAmount: JsonField, + private val metadata: JsonField, + private val minimum: JsonField, + private val minimumAmount: JsonField, + private val modelType: JsonValue, + private val name: JsonField, + private val packageConfig: JsonField, + private val planPhaseOrder: JsonField, + private val priceType: JsonField, + private val replacesPriceId: JsonField, + private val dimensionalPriceConfiguration: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("billable_metric") + @ExcludeMissing + billableMetric: JsonField = JsonMissing.of(), + @JsonProperty("billing_cycle_configuration") + @ExcludeMissing + billingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), + @JsonProperty("conversion_rate") + @ExcludeMissing + conversionRate: JsonField = JsonMissing.of(), + @JsonProperty("conversion_rate_config") + @ExcludeMissing + conversionRateConfig: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("credit_allocation") + @ExcludeMissing + creditAllocation: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + @JsonProperty("discount") + @ExcludeMissing + discount: JsonField = JsonMissing.of(), + @JsonProperty("external_price_id") + @ExcludeMissing + externalPriceId: JsonField = JsonMissing.of(), + @JsonProperty("fixed_price_quantity") + @ExcludeMissing + fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("invoicing_cycle_configuration") + @ExcludeMissing + invoicingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), + @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), + @JsonProperty("maximum_amount") + @ExcludeMissing + maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("minimum") @ExcludeMissing minimum: JsonField = JsonMissing.of(), + @JsonProperty("minimum_amount") + @ExcludeMissing + minimumAmount: JsonField = JsonMissing.of(), + @JsonProperty("model_type") @ExcludeMissing modelType: JsonValue = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("package_config") + @ExcludeMissing + packageConfig: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("price_type") + @ExcludeMissing + priceType: JsonField = JsonMissing.of(), + @JsonProperty("replaces_price_id") + @ExcludeMissing + replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), + ) : this( + id, + billableMetric, + billingCycleConfiguration, + cadence, + conversionRate, + conversionRateConfig, + createdAt, + creditAllocation, + currency, + discount, + externalPriceId, + fixedPriceQuantity, + invoicingCycleConfiguration, + item, + maximum, + maximumAmount, + metadata, + minimum, + minimumAmount, + modelType, + name, + packageConfig, + planPhaseOrder, + priceType, + replacesPriceId, + dimensionalPriceConfiguration, + 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 billableMetric(): Optional = + billableMetric.getOptional("billable_metric") + + /** + * @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 billingCycleConfiguration(): BillingCycleConfiguration = + billingCycleConfiguration.getRequired("billing_cycle_configuration") + + /** + * @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 cadence(): Cadence = cadence.getRequired("cadence") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun conversionRate(): Optional = conversionRate.getOptional("conversion_rate") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun conversionRateConfig(): Optional = + conversionRateConfig.getOptional("conversion_rate_config") + + /** + * @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 creditAllocation(): Optional = + creditAllocation.getOptional("credit_allocation") + + /** + * @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 (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun discount(): Optional = discount.getOptional("discount") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalPriceId(): Optional = externalPriceId.getOptional("external_price_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun fixedPriceQuantity(): Optional = + fixedPriceQuantity.getOptional("fixed_price_quantity") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun invoicingCycleConfiguration(): Optional = + invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration") + + /** + * @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 item(): ItemSlim = item.getRequired("item") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") fun maximum(): Optional = maximum.getOptional("maximum") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun maximumAmount(): Optional = maximumAmount.getOptional("maximum_amount") + + /** + * User specified key-value pairs for the resource. If not present, this defaults to an + * empty dictionary. Individual keys can be removed by setting the value to `null`, and the + * entire metadata mapping can be cleared by setting `metadata` to `null`. + * + * @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). + */ + @Deprecated("deprecated") fun minimum(): Optional = minimum.getOptional("minimum") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun minimumAmount(): Optional = minimumAmount.getOptional("minimum_amount") + + /** + * Expected to always return the following: + * ```java + * JsonValue.from("package") + * ``` + * + * However, this method can be useful for debugging and logging (e.g. if the server + * responded with an unexpected value). + */ + @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonValue = modelType + + /** + * @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") + + /** + * @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 packageConfig(): PackageConfig = packageConfig.getRequired("package_config") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun planPhaseOrder(): Optional = planPhaseOrder.getOptional("plan_phase_order") + + /** + * @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 priceType(): PriceType = priceType.getRequired("price_type") + + /** + * The price id this price replaces. This price will take the place of the replaced price in + * plan version migrations. + * + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_id") + + /** + * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun dimensionalPriceConfiguration(): Optional = + dimensionalPriceConfiguration.getOptional("dimensional_price_configuration") + + /** + * 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 [billableMetric]. + * + * Unlike [billableMetric], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("billable_metric") + @ExcludeMissing + fun _billableMetric(): JsonField = billableMetric + + /** + * Returns the raw JSON value of [billingCycleConfiguration]. + * + * Unlike [billingCycleConfiguration], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("billing_cycle_configuration") + @ExcludeMissing + fun _billingCycleConfiguration(): JsonField = + billingCycleConfiguration + + /** + * Returns the raw JSON value of [cadence]. + * + * Unlike [cadence], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence + + /** + * Returns the raw JSON value of [conversionRate]. + * + * Unlike [conversionRate], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("conversion_rate") + @ExcludeMissing + fun _conversionRate(): JsonField = conversionRate + + /** + * Returns the raw JSON value of [conversionRateConfig]. + * + * Unlike [conversionRateConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("conversion_rate_config") + @ExcludeMissing + fun _conversionRateConfig(): JsonField = conversionRateConfig + + /** + * 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 [creditAllocation]. + * + * Unlike [creditAllocation], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("credit_allocation") + @ExcludeMissing + fun _creditAllocation(): JsonField = creditAllocation + + /** + * 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 [discount]. + * + * Unlike [discount], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("discount") + @ExcludeMissing + fun _discount(): JsonField = discount + + /** + * Returns the raw JSON value of [externalPriceId]. + * + * Unlike [externalPriceId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_price_id") + @ExcludeMissing + fun _externalPriceId(): JsonField = externalPriceId + + /** + * Returns the raw JSON value of [fixedPriceQuantity]. + * + * Unlike [fixedPriceQuantity], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("fixed_price_quantity") + @ExcludeMissing + fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + + /** + * Returns the raw JSON value of [invoicingCycleConfiguration]. + * + * Unlike [invoicingCycleConfiguration], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("invoicing_cycle_configuration") + @ExcludeMissing + fun _invoicingCycleConfiguration(): JsonField = + invoicingCycleConfiguration + + /** + * Returns the raw JSON value of [item]. + * + * Unlike [item], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item + + /** + * Returns the raw JSON value of [maximum]. + * + * Unlike [maximum], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("maximum") + @ExcludeMissing + fun _maximum(): JsonField = maximum + + /** + * Returns the raw JSON value of [maximumAmount]. + * + * Unlike [maximumAmount], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @Deprecated("deprecated") + @JsonProperty("maximum_amount") + @ExcludeMissing + fun _maximumAmount(): JsonField = maximumAmount + + /** + * 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 [minimum]. + * + * Unlike [minimum], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("minimum") + @ExcludeMissing + fun _minimum(): JsonField = minimum + + /** + * Returns the raw JSON value of [minimumAmount]. + * + * Unlike [minimumAmount], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @Deprecated("deprecated") + @JsonProperty("minimum_amount") + @ExcludeMissing + fun _minimumAmount(): JsonField = minimumAmount + + /** + * 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 + + /** + * Returns the raw JSON value of [packageConfig]. + * + * Unlike [packageConfig], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("package_config") + @ExcludeMissing + fun _packageConfig(): JsonField = packageConfig + + /** + * Returns the raw JSON value of [planPhaseOrder]. + * + * Unlike [planPhaseOrder], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** + * Returns the raw JSON value of [priceType]. + * + * Unlike [priceType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("price_type") + @ExcludeMissing + fun _priceType(): JsonField = priceType + + /** + * Returns the raw JSON value of [replacesPriceId]. + * + * Unlike [replacesPriceId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("replaces_price_id") + @ExcludeMissing + fun _replacesPriceId(): JsonField = replacesPriceId + + /** + * Returns the raw JSON value of [dimensionalPriceConfiguration]. + * + * Unlike [dimensionalPriceConfiguration], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + + @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 [Package]. + * + * The following fields are required: + * ```java + * .id() + * .billableMetric() + * .billingCycleConfiguration() + * .cadence() + * .conversionRate() + * .conversionRateConfig() + * .createdAt() + * .creditAllocation() + * .currency() + * .discount() + * .externalPriceId() + * .fixedPriceQuantity() + * .invoicingCycleConfiguration() + * .item() + * .maximum() + * .maximumAmount() + * .metadata() + * .minimum() + * .minimumAmount() + * .name() + * .packageConfig() + * .planPhaseOrder() + * .priceType() + * .replacesPriceId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Package]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var billableMetric: JsonField? = null + private var billingCycleConfiguration: JsonField? = null + private var cadence: JsonField? = null + private var conversionRate: JsonField? = null + private var conversionRateConfig: JsonField? = null + private var createdAt: JsonField? = null + private var creditAllocation: JsonField? = null + private var currency: JsonField? = null + private var discount: JsonField? = null + private var externalPriceId: JsonField? = null + private var fixedPriceQuantity: JsonField? = null + private var invoicingCycleConfiguration: JsonField? = null + private var item: JsonField? = null + private var maximum: JsonField? = null + private var maximumAmount: JsonField? = null + private var metadata: JsonField? = null + private var minimum: JsonField? = null + private var minimumAmount: JsonField? = null + private var modelType: JsonValue = JsonValue.from("package") + private var name: JsonField? = null + private var packageConfig: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var priceType: JsonField? = null + private var replacesPriceId: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(package_: Package) = apply { + id = package_.id + billableMetric = package_.billableMetric + billingCycleConfiguration = package_.billingCycleConfiguration + cadence = package_.cadence + conversionRate = package_.conversionRate + conversionRateConfig = package_.conversionRateConfig + createdAt = package_.createdAt + creditAllocation = package_.creditAllocation + currency = package_.currency + discount = package_.discount + externalPriceId = package_.externalPriceId + fixedPriceQuantity = package_.fixedPriceQuantity + invoicingCycleConfiguration = package_.invoicingCycleConfiguration + item = package_.item + maximum = package_.maximum + maximumAmount = package_.maximumAmount + metadata = package_.metadata + minimum = package_.minimum + minimumAmount = package_.minimumAmount + modelType = package_.modelType + name = package_.name + packageConfig = package_.packageConfig + planPhaseOrder = package_.planPhaseOrder + priceType = package_.priceType + replacesPriceId = package_.replacesPriceId + dimensionalPriceConfiguration = package_.dimensionalPriceConfiguration + additionalProperties = package_.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 billableMetric(billableMetric: BillableMetricTiny?) = + billableMetric(JsonField.ofNullable(billableMetric)) + + /** Alias for calling [Builder.billableMetric] with `billableMetric.orElse(null)`. */ + fun billableMetric(billableMetric: Optional) = + billableMetric(billableMetric.getOrNull()) + + /** + * Sets [Builder.billableMetric] to an arbitrary JSON value. + * + * You should usually call [Builder.billableMetric] with a well-typed + * [BillableMetricTiny] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun billableMetric(billableMetric: JsonField) = apply { + this.billableMetric = billableMetric + } + + fun billingCycleConfiguration(billingCycleConfiguration: BillingCycleConfiguration) = + billingCycleConfiguration(JsonField.of(billingCycleConfiguration)) + + /** + * Sets [Builder.billingCycleConfiguration] to an arbitrary JSON value. + * + * You should usually call [Builder.billingCycleConfiguration] with a well-typed + * [BillingCycleConfiguration] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun billingCycleConfiguration( + billingCycleConfiguration: JsonField + ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } + + fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) + + /** + * Sets [Builder.cadence] to an arbitrary JSON value. + * + * You should usually call [Builder.cadence] with a well-typed [Cadence] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun cadence(cadence: JsonField) = apply { this.cadence = cadence } + + fun conversionRate(conversionRate: Double?) = + conversionRate(JsonField.ofNullable(conversionRate)) + + /** + * Alias for [Builder.conversionRate]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) + + /** Alias for calling [Builder.conversionRate] with `conversionRate.orElse(null)`. */ + fun conversionRate(conversionRate: Optional) = + conversionRate(conversionRate.getOrNull()) + + /** + * Sets [Builder.conversionRate] to an arbitrary JSON value. + * + * You should usually call [Builder.conversionRate] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun conversionRate(conversionRate: JsonField) = apply { + this.conversionRate = conversionRate + } + + fun conversionRateConfig(conversionRateConfig: ConversionRateConfig?) = + conversionRateConfig(JsonField.ofNullable(conversionRateConfig)) + + /** + * Alias for calling [Builder.conversionRateConfig] with + * `conversionRateConfig.orElse(null)`. + */ + fun conversionRateConfig(conversionRateConfig: Optional) = + conversionRateConfig(conversionRateConfig.getOrNull()) + + /** + * Sets [Builder.conversionRateConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.conversionRateConfig] with a well-typed + * [ConversionRateConfig] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun conversionRateConfig(conversionRateConfig: JsonField) = + apply { + this.conversionRateConfig = conversionRateConfig + } + + /** + * Alias for calling [conversionRateConfig] with `ConversionRateConfig.ofUnit(unit)`. + */ + fun conversionRateConfig(unit: UnitConversionRateConfig) = + conversionRateConfig(ConversionRateConfig.ofUnit(unit)) + + /** + * Alias for calling [conversionRateConfig] with the following: + * ```java + * UnitConversionRateConfig.builder() + * .conversionRateType(UnitConversionRateConfig.ConversionRateType.UNIT) + * .unitConfig(unitConfig) + * .build() + * ``` + */ + fun unitConversionRateConfig(unitConfig: ConversionRateUnitConfig) = + conversionRateConfig( + UnitConversionRateConfig.builder() + .conversionRateType(UnitConversionRateConfig.ConversionRateType.UNIT) + .unitConfig(unitConfig) + .build() + ) + + /** + * Alias for calling [conversionRateConfig] with + * `ConversionRateConfig.ofTiered(tiered)`. + */ + fun conversionRateConfig(tiered: TieredConversionRateConfig) = + conversionRateConfig(ConversionRateConfig.ofTiered(tiered)) + + /** + * Alias for calling [conversionRateConfig] with the following: + * ```java + * TieredConversionRateConfig.builder() + * .conversionRateType(TieredConversionRateConfig.ConversionRateType.TIERED) + * .tieredConfig(tieredConfig) + * .build() + * ``` + */ + fun tieredConversionRateConfig(tieredConfig: ConversionRateTieredConfig) = + conversionRateConfig( + TieredConversionRateConfig.builder() + .conversionRateType(TieredConversionRateConfig.ConversionRateType.TIERED) + .tieredConfig(tieredConfig) + .build() + ) + + 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 creditAllocation(creditAllocation: Allocation?) = + creditAllocation(JsonField.ofNullable(creditAllocation)) + + /** + * Alias for calling [Builder.creditAllocation] with `creditAllocation.orElse(null)`. + */ + fun creditAllocation(creditAllocation: Optional) = + creditAllocation(creditAllocation.getOrNull()) + + /** + * Sets [Builder.creditAllocation] to an arbitrary JSON value. + * + * You should usually call [Builder.creditAllocation] with a well-typed [Allocation] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun creditAllocation(creditAllocation: JsonField) = apply { + this.creditAllocation = creditAllocation + } + + 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 } + + @Deprecated("deprecated") + fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) + + /** Alias for calling [Builder.discount] with `discount.orElse(null)`. */ + @Deprecated("deprecated") + fun discount(discount: Optional) = discount(discount.getOrNull()) + + /** + * Sets [Builder.discount] to an arbitrary JSON value. + * + * You should usually call [Builder.discount] with a well-typed [Discount] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun discount(discount: JsonField) = apply { this.discount = discount } + + /** Alias for calling [discount] with `Discount.ofPercentage(percentage)`. */ + @Deprecated("deprecated") + fun discount(percentage: PercentageDiscount) = + discount(Discount.ofPercentage(percentage)) + + /** + * Alias for calling [discount] with the following: + * ```java + * PercentageDiscount.builder() + * .discountType(PercentageDiscount.DiscountType.PERCENTAGE) + * .percentageDiscount(percentageDiscount) + * .build() + * ``` + */ + @Deprecated("deprecated") + fun percentageDiscount(percentageDiscount: Double) = + discount( + PercentageDiscount.builder() + .discountType(PercentageDiscount.DiscountType.PERCENTAGE) + .percentageDiscount(percentageDiscount) + .build() + ) + + /** Alias for calling [discount] with `Discount.ofTrial(trial)`. */ + @Deprecated("deprecated") + fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + + /** Alias for calling [discount] with `Discount.ofUsage(usage)`. */ + @Deprecated("deprecated") + fun discount(usage: UsageDiscount) = discount(Discount.ofUsage(usage)) + + /** + * Alias for calling [discount] with the following: + * ```java + * UsageDiscount.builder() + * .discountType(UsageDiscount.DiscountType.USAGE) + * .usageDiscount(usageDiscount) + * .build() + * ``` + */ + @Deprecated("deprecated") + fun usageDiscount(usageDiscount: Double) = + discount( + UsageDiscount.builder() + .discountType(UsageDiscount.DiscountType.USAGE) + .usageDiscount(usageDiscount) + .build() + ) + + /** Alias for calling [discount] with `Discount.ofAmount(amount)`. */ + @Deprecated("deprecated") + fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) + + /** + * Alias for calling [discount] with the following: + * ```java + * AmountDiscount.builder() + * .discountType(AmountDiscount.DiscountType.AMOUNT) + * .amountDiscount(amountDiscount) + * .build() + * ``` + */ + @Deprecated("deprecated") + fun amountDiscount(amountDiscount: String) = + discount( + AmountDiscount.builder() + .discountType(AmountDiscount.DiscountType.AMOUNT) + .amountDiscount(amountDiscount) + .build() + ) + + fun externalPriceId(externalPriceId: String?) = + externalPriceId(JsonField.ofNullable(externalPriceId)) + + /** Alias for calling [Builder.externalPriceId] with `externalPriceId.orElse(null)`. */ + fun externalPriceId(externalPriceId: Optional) = + externalPriceId(externalPriceId.getOrNull()) + + /** + * Sets [Builder.externalPriceId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalPriceId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalPriceId(externalPriceId: JsonField) = apply { + this.externalPriceId = externalPriceId + } + + fun fixedPriceQuantity(fixedPriceQuantity: Double?) = + fixedPriceQuantity(JsonField.ofNullable(fixedPriceQuantity)) + + /** + * Alias for [Builder.fixedPriceQuantity]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun fixedPriceQuantity(fixedPriceQuantity: Double) = + fixedPriceQuantity(fixedPriceQuantity as Double?) + + /** + * Alias for calling [Builder.fixedPriceQuantity] with + * `fixedPriceQuantity.orElse(null)`. + */ + fun fixedPriceQuantity(fixedPriceQuantity: Optional) = + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) + + /** + * Sets [Builder.fixedPriceQuantity] to an arbitrary JSON value. + * + * You should usually call [Builder.fixedPriceQuantity] with a well-typed [Double] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { + this.fixedPriceQuantity = fixedPriceQuantity + } + + fun invoicingCycleConfiguration( + invoicingCycleConfiguration: BillingCycleConfiguration? + ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) + + /** + * Alias for calling [Builder.invoicingCycleConfiguration] with + * `invoicingCycleConfiguration.orElse(null)`. + */ + fun invoicingCycleConfiguration( + invoicingCycleConfiguration: Optional + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) + + /** + * Sets [Builder.invoicingCycleConfiguration] to an arbitrary JSON value. + * + * You should usually call [Builder.invoicingCycleConfiguration] with a well-typed + * [BillingCycleConfiguration] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun invoicingCycleConfiguration( + invoicingCycleConfiguration: JsonField + ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } + + fun item(item: ItemSlim) = item(JsonField.of(item)) + + /** + * Sets [Builder.item] to an arbitrary JSON value. + * + * You should usually call [Builder.item] with a well-typed [ItemSlim] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun item(item: JsonField) = apply { this.item = item } + + @Deprecated("deprecated") + fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) + + /** Alias for calling [Builder.maximum] with `maximum.orElse(null)`. */ + @Deprecated("deprecated") + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) + + /** + * Sets [Builder.maximum] to an arbitrary JSON value. + * + * You should usually call [Builder.maximum] with a well-typed [Maximum] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun maximum(maximum: JsonField) = apply { this.maximum = maximum } + + @Deprecated("deprecated") + fun maximumAmount(maximumAmount: String?) = + maximumAmount(JsonField.ofNullable(maximumAmount)) + + /** Alias for calling [Builder.maximumAmount] with `maximumAmount.orElse(null)`. */ + @Deprecated("deprecated") + fun maximumAmount(maximumAmount: Optional) = + maximumAmount(maximumAmount.getOrNull()) + + /** + * Sets [Builder.maximumAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.maximumAmount] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun maximumAmount(maximumAmount: JsonField) = apply { + this.maximumAmount = maximumAmount + } + + /** + * User specified key-value pairs for the resource. If not present, this defaults to an + * empty dictionary. Individual keys can be removed by setting the value to `null`, and + * the entire metadata mapping can be cleared by setting `metadata` to `null`. + */ + fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata)) + + /** + * 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 } + + @Deprecated("deprecated") + fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) + + /** Alias for calling [Builder.minimum] with `minimum.orElse(null)`. */ + @Deprecated("deprecated") + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) + + /** + * Sets [Builder.minimum] to an arbitrary JSON value. + * + * You should usually call [Builder.minimum] with a well-typed [Minimum] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun minimum(minimum: JsonField) = apply { this.minimum = minimum } + + @Deprecated("deprecated") + fun minimumAmount(minimumAmount: String?) = + minimumAmount(JsonField.ofNullable(minimumAmount)) + + /** Alias for calling [Builder.minimumAmount] with `minimumAmount.orElse(null)`. */ + @Deprecated("deprecated") + fun minimumAmount(minimumAmount: Optional) = + minimumAmount(minimumAmount.getOrNull()) + + /** + * Sets [Builder.minimumAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.minimumAmount] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun minimumAmount(minimumAmount: JsonField) = apply { + this.minimumAmount = minimumAmount + } + + /** + * Sets the field to an arbitrary JSON value. + * + * It is usually unnecessary to call this method because the field defaults to the + * following: + * ```java + * JsonValue.from("package") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -2129,6 +4151,20 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + fun packageConfig(packageConfig: PackageConfig) = + packageConfig(JsonField.of(packageConfig)) + + /** + * Sets [Builder.packageConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.packageConfig] with a well-typed [PackageConfig] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun packageConfig(packageConfig: JsonField) = apply { + this.packageConfig = packageConfig + } + fun planPhaseOrder(planPhaseOrder: Long?) = planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) @@ -2187,19 +4223,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun unitConfig(unitConfig: UnitConfig) = unitConfig(JsonField.of(unitConfig)) - - /** - * Sets [Builder.unitConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.unitConfig] with a well-typed [UnitConfig] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun unitConfig(unitConfig: JsonField) = apply { - this.unitConfig = unitConfig - } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -2243,7 +4266,7 @@ private constructor( } /** - * Returns an immutable instance of [Unit]. + * Returns an immutable instance of [Package]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -2269,16 +4292,16 @@ private constructor( * .minimum() * .minimumAmount() * .name() + * .packageConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .unitConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Unit = - Unit( + fun build(): Package = + Package( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -2300,10 +4323,10 @@ private constructor( checkRequired("minimumAmount", minimumAmount), modelType, checkRequired("name", name), + checkRequired("packageConfig", packageConfig), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("unitConfig", unitConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -2311,7 +4334,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Unit = apply { + fun validate(): Package = apply { if (validated) { return@apply } @@ -2336,15 +4359,15 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("unit")) { + if (it != JsonValue.from("package")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } name() + packageConfig().validate() planPhaseOrder() priceType().validate() replacesPriceId() - unitConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -2384,12 +4407,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("unit")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("package")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + + (packageConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (unitConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -2969,20 +4992,20 @@ private constructor( return true } - return /* spotless:off */ other is Unit && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && unitConfig == other.unitConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Package && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && packageConfig == other.packageConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, unitConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, packageConfig, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Unit{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "Package{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class Package + class Matrix private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -2998,6 +5021,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, + private val matrixConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -3005,7 +5029,6 @@ private constructor( private val minimumAmount: JsonField, private val modelType: JsonValue, private val name: JsonField, - private val packageConfig: JsonField, private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, @@ -3051,6 +5074,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), + @JsonProperty("matrix_config") + @ExcludeMissing + matrixConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -3064,9 +5090,6 @@ private constructor( minimumAmount: JsonField = JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing modelType: JsonValue = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), - @JsonProperty("package_config") - @ExcludeMissing - packageConfig: JsonField = JsonMissing.of(), @JsonProperty("plan_phase_order") @ExcludeMissing planPhaseOrder: JsonField = JsonMissing.of(), @@ -3095,6 +5118,7 @@ private constructor( fixedPriceQuantity, invoicingCycleConfiguration, item, + matrixConfig, maximum, maximumAmount, metadata, @@ -3102,7 +5126,6 @@ private constructor( minimumAmount, modelType, name, - packageConfig, planPhaseOrder, priceType, replacesPriceId, @@ -3201,6 +5224,12 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") + /** + * @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 matrixConfig(): MatrixConfig = matrixConfig.getRequired("matrix_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -3240,7 +5269,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("package") + * JsonValue.from("matrix") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -3254,12 +5283,6 @@ private constructor( */ fun name(): String = name.getRequired("name") - /** - * @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 packageConfig(): PackageConfig = packageConfig.getRequired("package_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -3417,6 +5440,16 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item + /** + * Returns the raw JSON value of [matrixConfig]. + * + * Unlike [matrixConfig], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("matrix_config") + @ExcludeMissing + fun _matrixConfig(): JsonField = matrixConfig + /** * Returns the raw JSON value of [maximum]. * @@ -3473,16 +5506,6 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - /** - * Returns the raw JSON value of [packageConfig]. - * - * Unlike [packageConfig], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("package_config") - @ExcludeMissing - fun _packageConfig(): JsonField = packageConfig - /** * Returns the raw JSON value of [planPhaseOrder]. * @@ -3538,7 +5561,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Package]. + * Returns a mutable builder for constructing an instance of [Matrix]. * * The following fields are required: * ```java @@ -3556,13 +5579,13 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() + * .matrixConfig() * .maximum() * .maximumAmount() * .metadata() * .minimum() * .minimumAmount() * .name() - * .packageConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() @@ -3571,7 +5594,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Package]. */ + /** A builder for [Matrix]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -3588,14 +5611,14 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null + private var matrixConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("package") + private var modelType: JsonValue = JsonValue.from("matrix") private var name: JsonField? = null - private var packageConfig: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null @@ -3604,34 +5627,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(package_: Package) = apply { - id = package_.id - billableMetric = package_.billableMetric - billingCycleConfiguration = package_.billingCycleConfiguration - cadence = package_.cadence - conversionRate = package_.conversionRate - conversionRateConfig = package_.conversionRateConfig - createdAt = package_.createdAt - creditAllocation = package_.creditAllocation - currency = package_.currency - discount = package_.discount - externalPriceId = package_.externalPriceId - fixedPriceQuantity = package_.fixedPriceQuantity - invoicingCycleConfiguration = package_.invoicingCycleConfiguration - item = package_.item - maximum = package_.maximum - maximumAmount = package_.maximumAmount - metadata = package_.metadata - minimum = package_.minimum - minimumAmount = package_.minimumAmount - modelType = package_.modelType - name = package_.name - packageConfig = package_.packageConfig - planPhaseOrder = package_.planPhaseOrder - priceType = package_.priceType - replacesPriceId = package_.replacesPriceId - dimensionalPriceConfiguration = package_.dimensionalPriceConfiguration - additionalProperties = package_.additionalProperties.toMutableMap() + internal fun from(matrix: Matrix) = apply { + id = matrix.id + billableMetric = matrix.billableMetric + billingCycleConfiguration = matrix.billingCycleConfiguration + cadence = matrix.cadence + conversionRate = matrix.conversionRate + conversionRateConfig = matrix.conversionRateConfig + createdAt = matrix.createdAt + creditAllocation = matrix.creditAllocation + currency = matrix.currency + discount = matrix.discount + externalPriceId = matrix.externalPriceId + fixedPriceQuantity = matrix.fixedPriceQuantity + invoicingCycleConfiguration = matrix.invoicingCycleConfiguration + item = matrix.item + matrixConfig = matrix.matrixConfig + maximum = matrix.maximum + maximumAmount = matrix.maximumAmount + metadata = matrix.metadata + minimum = matrix.minimum + minimumAmount = matrix.minimumAmount + modelType = matrix.modelType + name = matrix.name + planPhaseOrder = matrix.planPhaseOrder + priceType = matrix.priceType + replacesPriceId = matrix.replacesPriceId + dimensionalPriceConfiguration = matrix.dimensionalPriceConfiguration + additionalProperties = matrix.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -3995,6 +6018,19 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } + fun matrixConfig(matrixConfig: MatrixConfig) = matrixConfig(JsonField.of(matrixConfig)) + + /** + * Sets [Builder.matrixConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.matrixConfig] with a well-typed [MatrixConfig] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun matrixConfig(matrixConfig: JsonField) = apply { + this.matrixConfig = matrixConfig + } + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -4093,7 +6129,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("package") + * JsonValue.from("matrix") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -4112,20 +6148,6 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - fun packageConfig(packageConfig: PackageConfig) = - packageConfig(JsonField.of(packageConfig)) - - /** - * Sets [Builder.packageConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.packageConfig] with a well-typed [PackageConfig] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun packageConfig(packageConfig: JsonField) = apply { - this.packageConfig = packageConfig - } - fun planPhaseOrder(planPhaseOrder: Long?) = planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) @@ -4227,7 +6249,7 @@ private constructor( } /** - * Returns an immutable instance of [Package]. + * Returns an immutable instance of [Matrix]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -4247,13 +6269,13 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() + * .matrixConfig() * .maximum() * .maximumAmount() * .metadata() * .minimum() * .minimumAmount() * .name() - * .packageConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() @@ -4261,8 +6283,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Package = - Package( + fun build(): Matrix = + Matrix( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -4277,6 +6299,7 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), + checkRequired("matrixConfig", matrixConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -4284,7 +6307,6 @@ private constructor( checkRequired("minimumAmount", minimumAmount), modelType, checkRequired("name", name), - checkRequired("packageConfig", packageConfig), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), @@ -4295,7 +6317,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Package = apply { + fun validate(): Matrix = apply { if (validated) { return@apply } @@ -4314,18 +6336,18 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() + matrixConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("package")) { + if (it != JsonValue.from("matrix")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } name() - packageConfig().validate() planPhaseOrder() priceType().validate() replacesPriceId() @@ -4363,14 +6385,14 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + + (matrixConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("package")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("matrix")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + - (packageConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + @@ -4953,20 +6975,20 @@ private constructor( return true } - return /* spotless:off */ other is Package && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && packageConfig == other.packageConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Matrix && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixConfig == other.matrixConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, packageConfig, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Package{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "Matrix{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class Matrix + class Tiered private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -4982,7 +7004,6 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, - private val matrixConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -4993,6 +7014,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, + private val tieredConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -5035,9 +7057,6 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), - @JsonProperty("matrix_config") - @ExcludeMissing - matrixConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -5060,6 +7079,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("tiered_config") + @ExcludeMissing + tieredConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -5079,7 +7101,6 @@ private constructor( fixedPriceQuantity, invoicingCycleConfiguration, item, - matrixConfig, maximum, maximumAmount, metadata, @@ -5090,6 +7111,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, + tieredConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -5185,12 +7207,6 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") - /** - * @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 matrixConfig(): MatrixConfig = matrixConfig.getRequired("matrix_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -5230,7 +7246,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("matrix") + * JsonValue.from("tiered") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -5265,6 +7281,12 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 tieredConfig(): TieredConfig = tieredConfig.getRequired("tiered_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -5401,16 +7423,6 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - /** - * Returns the raw JSON value of [matrixConfig]. - * - * Unlike [matrixConfig], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("matrix_config") - @ExcludeMissing - fun _matrixConfig(): JsonField = matrixConfig - /** * Returns the raw JSON value of [maximum]. * @@ -5496,6 +7508,16 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId + /** + * Returns the raw JSON value of [tieredConfig]. + * + * Unlike [tieredConfig], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("tiered_config") + @ExcludeMissing + fun _tieredConfig(): JsonField = tieredConfig + /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -5522,7 +7544,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Matrix]. + * Returns a mutable builder for constructing an instance of [Tiered]. * * The following fields are required: * ```java @@ -5540,7 +7562,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .matrixConfig() * .maximum() * .maximumAmount() * .metadata() @@ -5550,12 +7571,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .tieredConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Matrix]. */ + /** A builder for [Tiered]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -5572,50 +7594,50 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var matrixConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("matrix") + private var modelType: JsonValue = JsonValue.from("tiered") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null + private var tieredConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(matrix: Matrix) = apply { - id = matrix.id - billableMetric = matrix.billableMetric - billingCycleConfiguration = matrix.billingCycleConfiguration - cadence = matrix.cadence - conversionRate = matrix.conversionRate - conversionRateConfig = matrix.conversionRateConfig - createdAt = matrix.createdAt - creditAllocation = matrix.creditAllocation - currency = matrix.currency - discount = matrix.discount - externalPriceId = matrix.externalPriceId - fixedPriceQuantity = matrix.fixedPriceQuantity - invoicingCycleConfiguration = matrix.invoicingCycleConfiguration - item = matrix.item - matrixConfig = matrix.matrixConfig - maximum = matrix.maximum - maximumAmount = matrix.maximumAmount - metadata = matrix.metadata - minimum = matrix.minimum - minimumAmount = matrix.minimumAmount - modelType = matrix.modelType - name = matrix.name - planPhaseOrder = matrix.planPhaseOrder - priceType = matrix.priceType - replacesPriceId = matrix.replacesPriceId - dimensionalPriceConfiguration = matrix.dimensionalPriceConfiguration - additionalProperties = matrix.additionalProperties.toMutableMap() + internal fun from(tiered: Tiered) = apply { + id = tiered.id + billableMetric = tiered.billableMetric + billingCycleConfiguration = tiered.billingCycleConfiguration + cadence = tiered.cadence + conversionRate = tiered.conversionRate + conversionRateConfig = tiered.conversionRateConfig + createdAt = tiered.createdAt + creditAllocation = tiered.creditAllocation + currency = tiered.currency + discount = tiered.discount + externalPriceId = tiered.externalPriceId + fixedPriceQuantity = tiered.fixedPriceQuantity + invoicingCycleConfiguration = tiered.invoicingCycleConfiguration + item = tiered.item + maximum = tiered.maximum + maximumAmount = tiered.maximumAmount + metadata = tiered.metadata + minimum = tiered.minimum + minimumAmount = tiered.minimumAmount + modelType = tiered.modelType + name = tiered.name + planPhaseOrder = tiered.planPhaseOrder + priceType = tiered.priceType + replacesPriceId = tiered.replacesPriceId + tieredConfig = tiered.tieredConfig + dimensionalPriceConfiguration = tiered.dimensionalPriceConfiguration + additionalProperties = tiered.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -5979,19 +8001,6 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } - fun matrixConfig(matrixConfig: MatrixConfig) = matrixConfig(JsonField.of(matrixConfig)) - - /** - * Sets [Builder.matrixConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.matrixConfig] with a well-typed [MatrixConfig] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun matrixConfig(matrixConfig: JsonField) = apply { - this.matrixConfig = matrixConfig - } - @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -6090,7 +8099,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("matrix") + * JsonValue.from("tiered") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -6167,6 +8176,19 @@ private constructor( this.replacesPriceId = replacesPriceId } + fun tieredConfig(tieredConfig: TieredConfig) = tieredConfig(JsonField.of(tieredConfig)) + + /** + * Sets [Builder.tieredConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.tieredConfig] with a well-typed [TieredConfig] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tieredConfig(tieredConfig: JsonField) = apply { + this.tieredConfig = tieredConfig + } + fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -6210,7 +8232,7 @@ private constructor( } /** - * Returns an immutable instance of [Matrix]. + * Returns an immutable instance of [Tiered]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -6230,7 +8252,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .matrixConfig() * .maximum() * .maximumAmount() * .metadata() @@ -6240,12 +8261,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .tieredConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Matrix = - Matrix( + fun build(): Tiered = + Tiered( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -6260,7 +8282,6 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("matrixConfig", matrixConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -6271,6 +8292,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), + checkRequired("tieredConfig", tieredConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -6278,7 +8300,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Matrix = apply { + fun validate(): Tiered = apply { if (validated) { return@apply } @@ -6297,14 +8319,13 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - matrixConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("matrix")) { + if (it != JsonValue.from("tiered")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -6312,6 +8333,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() + tieredConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -6346,17 +8368,17 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + - (matrixConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("matrix")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("tiered")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (tieredConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -6936,20 +8958,20 @@ private constructor( return true } - return /* spotless:off */ other is Matrix && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixConfig == other.matrixConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Tiered && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredConfig == other.tieredConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Matrix{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "Tiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class Tiered + class TieredBps private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -6975,7 +8997,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val tieredConfig: JsonField, + private val tieredBpsConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -7040,9 +9062,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("tiered_config") + @JsonProperty("tiered_bps_config") @ExcludeMissing - tieredConfig: JsonField = JsonMissing.of(), + tieredBpsConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -7072,7 +9094,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - tieredConfig, + tieredBpsConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -7207,7 +9229,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("tiered") + * JsonValue.from("tiered_bps") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -7246,7 +9268,7 @@ private constructor( * @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 tieredConfig(): TieredConfig = tieredConfig.getRequired("tiered_config") + fun tieredBpsConfig(): TieredBpsConfig = tieredBpsConfig.getRequired("tiered_bps_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -7470,14 +9492,14 @@ private constructor( fun _replacesPriceId(): JsonField = replacesPriceId /** - * Returns the raw JSON value of [tieredConfig]. + * Returns the raw JSON value of [tieredBpsConfig]. * - * Unlike [tieredConfig], this method doesn't throw if the JSON field has an unexpected + * Unlike [tieredBpsConfig], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("tiered_config") + @JsonProperty("tiered_bps_config") @ExcludeMissing - fun _tieredConfig(): JsonField = tieredConfig + fun _tieredBpsConfig(): JsonField = tieredBpsConfig /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. @@ -7505,7 +9527,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Tiered]. + * Returns a mutable builder for constructing an instance of [TieredBps]. * * The following fields are required: * ```java @@ -7532,13 +9554,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredConfig() + * .tieredBpsConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Tiered]. */ + /** A builder for [TieredBps]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -7560,45 +9582,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("tiered") + private var modelType: JsonValue = JsonValue.from("tiered_bps") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var tieredConfig: JsonField? = null + private var tieredBpsConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tiered: Tiered) = apply { - id = tiered.id - billableMetric = tiered.billableMetric - billingCycleConfiguration = tiered.billingCycleConfiguration - cadence = tiered.cadence - conversionRate = tiered.conversionRate - conversionRateConfig = tiered.conversionRateConfig - createdAt = tiered.createdAt - creditAllocation = tiered.creditAllocation - currency = tiered.currency - discount = tiered.discount - externalPriceId = tiered.externalPriceId - fixedPriceQuantity = tiered.fixedPriceQuantity - invoicingCycleConfiguration = tiered.invoicingCycleConfiguration - item = tiered.item - maximum = tiered.maximum - maximumAmount = tiered.maximumAmount - metadata = tiered.metadata - minimum = tiered.minimum - minimumAmount = tiered.minimumAmount - modelType = tiered.modelType - name = tiered.name - planPhaseOrder = tiered.planPhaseOrder - priceType = tiered.priceType - replacesPriceId = tiered.replacesPriceId - tieredConfig = tiered.tieredConfig - dimensionalPriceConfiguration = tiered.dimensionalPriceConfiguration - additionalProperties = tiered.additionalProperties.toMutableMap() + internal fun from(tieredBps: TieredBps) = apply { + id = tieredBps.id + billableMetric = tieredBps.billableMetric + billingCycleConfiguration = tieredBps.billingCycleConfiguration + cadence = tieredBps.cadence + conversionRate = tieredBps.conversionRate + conversionRateConfig = tieredBps.conversionRateConfig + createdAt = tieredBps.createdAt + creditAllocation = tieredBps.creditAllocation + currency = tieredBps.currency + discount = tieredBps.discount + externalPriceId = tieredBps.externalPriceId + fixedPriceQuantity = tieredBps.fixedPriceQuantity + invoicingCycleConfiguration = tieredBps.invoicingCycleConfiguration + item = tieredBps.item + maximum = tieredBps.maximum + maximumAmount = tieredBps.maximumAmount + metadata = tieredBps.metadata + minimum = tieredBps.minimum + minimumAmount = tieredBps.minimumAmount + modelType = tieredBps.modelType + name = tieredBps.name + planPhaseOrder = tieredBps.planPhaseOrder + priceType = tieredBps.priceType + replacesPriceId = tieredBps.replacesPriceId + tieredBpsConfig = tieredBps.tieredBpsConfig + dimensionalPriceConfiguration = tieredBps.dimensionalPriceConfiguration + additionalProperties = tieredBps.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -8060,7 +10082,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("tiered") + * JsonValue.from("tiered_bps") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -8137,17 +10159,18 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun tieredConfig(tieredConfig: TieredConfig) = tieredConfig(JsonField.of(tieredConfig)) + fun tieredBpsConfig(tieredBpsConfig: TieredBpsConfig) = + tieredBpsConfig(JsonField.of(tieredBpsConfig)) /** - * Sets [Builder.tieredConfig] to an arbitrary JSON value. + * Sets [Builder.tieredBpsConfig] to an arbitrary JSON value. * - * You should usually call [Builder.tieredConfig] with a well-typed [TieredConfig] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. + * You should usually call [Builder.tieredBpsConfig] with a well-typed [TieredBpsConfig] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. */ - fun tieredConfig(tieredConfig: JsonField) = apply { - this.tieredConfig = tieredConfig + fun tieredBpsConfig(tieredBpsConfig: JsonField) = apply { + this.tieredBpsConfig = tieredBpsConfig } fun dimensionalPriceConfiguration( @@ -8193,7 +10216,7 @@ private constructor( } /** - * Returns an immutable instance of [Tiered]. + * Returns an immutable instance of [TieredBps]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -8222,13 +10245,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredConfig() + * .tieredBpsConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Tiered = - Tiered( + fun build(): TieredBps = + TieredBps( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -8253,7 +10276,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("tieredConfig", tieredConfig), + checkRequired("tieredBpsConfig", tieredBpsConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -8261,7 +10284,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Tiered = apply { + fun validate(): TieredBps = apply { if (validated) { return@apply } @@ -8286,7 +10309,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("tiered")) { + if (it != JsonValue.from("tiered_bps")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -8294,7 +10317,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - tieredConfig().validate() + tieredBpsConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -8334,12 +10357,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("tiered")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("tiered_bps")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (tieredConfig.asKnown().getOrNull()?.validity() ?: 0) + + (tieredBpsConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -8919,24 +10942,25 @@ private constructor( return true } - return /* spotless:off */ other is Tiered && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredConfig == other.tieredConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredBps && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredBpsConfig == other.tieredBpsConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredBpsConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Tiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "TieredBps{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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, tieredBpsConfig=$tieredBpsConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } - class TieredBps + class Bps private constructor( private val id: JsonField, private val billableMetric: JsonField, private val billingCycleConfiguration: JsonField, + private val bpsConfig: JsonField, private val cadence: JsonField, private val conversionRate: JsonField, private val conversionRateConfig: JsonField, @@ -8958,7 +10982,6 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val tieredBpsConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -8972,6 +10995,9 @@ private constructor( @JsonProperty("billing_cycle_configuration") @ExcludeMissing billingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("bps_config") + @ExcludeMissing + bpsConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), @JsonProperty("conversion_rate") @ExcludeMissing @@ -9023,9 +11049,6 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("tiered_bps_config") - @ExcludeMissing - tieredBpsConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -9034,6 +11057,7 @@ private constructor( id, billableMetric, billingCycleConfiguration, + bpsConfig, cadence, conversionRate, conversionRateConfig, @@ -9055,7 +11079,6 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - tieredBpsConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -9080,6 +11103,12 @@ private constructor( fun billingCycleConfiguration(): BillingCycleConfiguration = billingCycleConfiguration.getRequired("billing_cycle_configuration") + /** + * @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 bpsConfig(): BpsConfig = bpsConfig.getRequired("bps_config") + /** * @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). @@ -9190,7 +11219,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("tiered_bps") + * JsonValue.from("bps") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -9225,12 +11254,6 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 tieredBpsConfig(): TieredBpsConfig = tieredBpsConfig.getRequired("tiered_bps_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -9266,6 +11289,15 @@ private constructor( fun _billingCycleConfiguration(): JsonField = billingCycleConfiguration + /** + * Returns the raw JSON value of [bpsConfig]. + * + * Unlike [bpsConfig], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("bps_config") + @ExcludeMissing + fun _bpsConfig(): JsonField = bpsConfig + /** * Returns the raw JSON value of [cadence]. * @@ -9452,16 +11484,6 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId - /** - * Returns the raw JSON value of [tieredBpsConfig]. - * - * Unlike [tieredBpsConfig], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("tiered_bps_config") - @ExcludeMissing - fun _tieredBpsConfig(): JsonField = tieredBpsConfig - /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -9488,13 +11510,14 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [TieredBps]. + * Returns a mutable builder for constructing an instance of [Bps]. * * The following fields are required: * ```java * .id() * .billableMetric() * .billingCycleConfiguration() + * .bpsConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -9515,18 +11538,18 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredBpsConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredBps]. */ + /** A builder for [Bps]. */ class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null + private var bpsConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var conversionRateConfig: JsonField? = null @@ -9543,45 +11566,44 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("tiered_bps") + private var modelType: JsonValue = JsonValue.from("bps") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var tieredBpsConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredBps: TieredBps) = apply { - id = tieredBps.id - billableMetric = tieredBps.billableMetric - billingCycleConfiguration = tieredBps.billingCycleConfiguration - cadence = tieredBps.cadence - conversionRate = tieredBps.conversionRate - conversionRateConfig = tieredBps.conversionRateConfig - createdAt = tieredBps.createdAt - creditAllocation = tieredBps.creditAllocation - currency = tieredBps.currency - discount = tieredBps.discount - externalPriceId = tieredBps.externalPriceId - fixedPriceQuantity = tieredBps.fixedPriceQuantity - invoicingCycleConfiguration = tieredBps.invoicingCycleConfiguration - item = tieredBps.item - maximum = tieredBps.maximum - maximumAmount = tieredBps.maximumAmount - metadata = tieredBps.metadata - minimum = tieredBps.minimum - minimumAmount = tieredBps.minimumAmount - modelType = tieredBps.modelType - name = tieredBps.name - planPhaseOrder = tieredBps.planPhaseOrder - priceType = tieredBps.priceType - replacesPriceId = tieredBps.replacesPriceId - tieredBpsConfig = tieredBps.tieredBpsConfig - dimensionalPriceConfiguration = tieredBps.dimensionalPriceConfiguration - additionalProperties = tieredBps.additionalProperties.toMutableMap() + internal fun from(bps: Bps) = apply { + id = bps.id + billableMetric = bps.billableMetric + billingCycleConfiguration = bps.billingCycleConfiguration + bpsConfig = bps.bpsConfig + cadence = bps.cadence + conversionRate = bps.conversionRate + conversionRateConfig = bps.conversionRateConfig + createdAt = bps.createdAt + creditAllocation = bps.creditAllocation + currency = bps.currency + discount = bps.discount + externalPriceId = bps.externalPriceId + fixedPriceQuantity = bps.fixedPriceQuantity + invoicingCycleConfiguration = bps.invoicingCycleConfiguration + item = bps.item + maximum = bps.maximum + maximumAmount = bps.maximumAmount + metadata = bps.metadata + minimum = bps.minimum + minimumAmount = bps.minimumAmount + modelType = bps.modelType + name = bps.name + planPhaseOrder = bps.planPhaseOrder + priceType = bps.priceType + replacesPriceId = bps.replacesPriceId + dimensionalPriceConfiguration = bps.dimensionalPriceConfiguration + additionalProperties = bps.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -9627,6 +11649,17 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } + fun bpsConfig(bpsConfig: BpsConfig) = bpsConfig(JsonField.of(bpsConfig)) + + /** + * Sets [Builder.bpsConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.bpsConfig] with a well-typed [BpsConfig] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun bpsConfig(bpsConfig: JsonField) = apply { this.bpsConfig = bpsConfig } + fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) /** @@ -10043,7 +12076,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("tiered_bps") + * JsonValue.from("bps") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -10120,20 +12153,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun tieredBpsConfig(tieredBpsConfig: TieredBpsConfig) = - tieredBpsConfig(JsonField.of(tieredBpsConfig)) - - /** - * Sets [Builder.tieredBpsConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.tieredBpsConfig] with a well-typed [TieredBpsConfig] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun tieredBpsConfig(tieredBpsConfig: JsonField) = apply { - this.tieredBpsConfig = tieredBpsConfig - } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -10177,7 +12196,7 @@ private constructor( } /** - * Returns an immutable instance of [TieredBps]. + * Returns an immutable instance of [Bps]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -10186,6 +12205,7 @@ private constructor( * .id() * .billableMetric() * .billingCycleConfiguration() + * .bpsConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -10206,16 +12226,16 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredBpsConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): TieredBps = - TieredBps( + fun build(): Bps = + Bps( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), + checkRequired("bpsConfig", bpsConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("conversionRateConfig", conversionRateConfig), @@ -10237,7 +12257,6 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("tieredBpsConfig", tieredBpsConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -10245,7 +12264,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TieredBps = apply { + fun validate(): Bps = apply { if (validated) { return@apply } @@ -10253,6 +12272,7 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() + bpsConfig().validate() cadence().validate() conversionRate() conversionRateConfig().ifPresent { it.validate() } @@ -10270,7 +12290,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("tiered_bps")) { + if (it != JsonValue.from("bps")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -10278,7 +12298,6 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - tieredBpsConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -10302,6 +12321,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (bpsConfig.asKnown().getOrNull()?.validity() ?: 0) + (cadence.asKnown().getOrNull()?.validity() ?: 0) + (if (conversionRate.asKnown().isPresent) 1 else 0) + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + @@ -10318,12 +12338,11 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("tiered_bps")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("bps")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (tieredBpsConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -10903,25 +12922,25 @@ private constructor( return true } - return /* spotless:off */ other is TieredBps && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredBpsConfig == other.tieredBpsConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Bps && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bpsConfig == other.bpsConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredBpsConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bpsConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredBps{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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, tieredBpsConfig=$tieredBpsConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + "Bps{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bpsConfig=$bpsConfig, cadence=$cadence, 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}" } - class Bps + class BulkBps private constructor( private val id: JsonField, private val billableMetric: JsonField, private val billingCycleConfiguration: JsonField, - private val bpsConfig: JsonField, + private val bulkBpsConfig: JsonField, private val cadence: JsonField, private val conversionRate: JsonField, private val conversionRateConfig: JsonField, @@ -10956,9 +12975,9 @@ private constructor( @JsonProperty("billing_cycle_configuration") @ExcludeMissing billingCycleConfiguration: JsonField = JsonMissing.of(), - @JsonProperty("bps_config") + @JsonProperty("bulk_bps_config") @ExcludeMissing - bpsConfig: JsonField = JsonMissing.of(), + bulkBpsConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), @JsonProperty("conversion_rate") @ExcludeMissing @@ -11018,7 +13037,7 @@ private constructor( id, billableMetric, billingCycleConfiguration, - bpsConfig, + bulkBpsConfig, cadence, conversionRate, conversionRateConfig, @@ -11068,7 +13087,7 @@ private constructor( * @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 bpsConfig(): BpsConfig = bpsConfig.getRequired("bps_config") + fun bulkBpsConfig(): BulkBpsConfig = bulkBpsConfig.getRequired("bulk_bps_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type or is @@ -11180,7 +13199,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("bps") + * JsonValue.from("bulk_bps") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -11251,13 +13270,14 @@ private constructor( billingCycleConfiguration /** - * Returns the raw JSON value of [bpsConfig]. + * Returns the raw JSON value of [bulkBpsConfig]. * - * Unlike [bpsConfig], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [bulkBpsConfig], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("bps_config") + @JsonProperty("bulk_bps_config") @ExcludeMissing - fun _bpsConfig(): JsonField = bpsConfig + fun _bulkBpsConfig(): JsonField = bulkBpsConfig /** * Returns the raw JSON value of [cadence]. @@ -11471,14 +13491,14 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Bps]. + * Returns a mutable builder for constructing an instance of [BulkBps]. * * The following fields are required: * ```java * .id() * .billableMetric() * .billingCycleConfiguration() - * .bpsConfig() + * .bulkBpsConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -11504,13 +13524,13 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Bps]. */ + /** A builder for [BulkBps]. */ class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null - private var bpsConfig: JsonField? = null + private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var conversionRateConfig: JsonField? = null @@ -11527,7 +13547,7 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("bps") + private var modelType: JsonValue = JsonValue.from("bulk_bps") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -11537,34 +13557,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bps: Bps) = apply { - id = bps.id - billableMetric = bps.billableMetric - billingCycleConfiguration = bps.billingCycleConfiguration - bpsConfig = bps.bpsConfig - cadence = bps.cadence - conversionRate = bps.conversionRate - conversionRateConfig = bps.conversionRateConfig - createdAt = bps.createdAt - creditAllocation = bps.creditAllocation - currency = bps.currency - discount = bps.discount - externalPriceId = bps.externalPriceId - fixedPriceQuantity = bps.fixedPriceQuantity - invoicingCycleConfiguration = bps.invoicingCycleConfiguration - item = bps.item - maximum = bps.maximum - maximumAmount = bps.maximumAmount - metadata = bps.metadata - minimum = bps.minimum - minimumAmount = bps.minimumAmount - modelType = bps.modelType - name = bps.name - planPhaseOrder = bps.planPhaseOrder - priceType = bps.priceType - replacesPriceId = bps.replacesPriceId - dimensionalPriceConfiguration = bps.dimensionalPriceConfiguration - additionalProperties = bps.additionalProperties.toMutableMap() + internal fun from(bulkBps: BulkBps) = apply { + id = bulkBps.id + billableMetric = bulkBps.billableMetric + billingCycleConfiguration = bulkBps.billingCycleConfiguration + bulkBpsConfig = bulkBps.bulkBpsConfig + cadence = bulkBps.cadence + conversionRate = bulkBps.conversionRate + conversionRateConfig = bulkBps.conversionRateConfig + createdAt = bulkBps.createdAt + creditAllocation = bulkBps.creditAllocation + currency = bulkBps.currency + discount = bulkBps.discount + externalPriceId = bulkBps.externalPriceId + fixedPriceQuantity = bulkBps.fixedPriceQuantity + invoicingCycleConfiguration = bulkBps.invoicingCycleConfiguration + item = bulkBps.item + maximum = bulkBps.maximum + maximumAmount = bulkBps.maximumAmount + metadata = bulkBps.metadata + minimum = bulkBps.minimum + minimumAmount = bulkBps.minimumAmount + modelType = bulkBps.modelType + name = bulkBps.name + planPhaseOrder = bulkBps.planPhaseOrder + priceType = bulkBps.priceType + replacesPriceId = bulkBps.replacesPriceId + dimensionalPriceConfiguration = bulkBps.dimensionalPriceConfiguration + additionalProperties = bulkBps.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -11610,16 +13630,19 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } - fun bpsConfig(bpsConfig: BpsConfig) = bpsConfig(JsonField.of(bpsConfig)) + fun bulkBpsConfig(bulkBpsConfig: BulkBpsConfig) = + bulkBpsConfig(JsonField.of(bulkBpsConfig)) /** - * Sets [Builder.bpsConfig] to an arbitrary JSON value. + * Sets [Builder.bulkBpsConfig] to an arbitrary JSON value. * - * You should usually call [Builder.bpsConfig] with a well-typed [BpsConfig] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. + * You should usually call [Builder.bulkBpsConfig] with a well-typed [BulkBpsConfig] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. */ - fun bpsConfig(bpsConfig: JsonField) = apply { this.bpsConfig = bpsConfig } + fun bulkBpsConfig(bulkBpsConfig: JsonField) = apply { + this.bulkBpsConfig = bulkBpsConfig + } fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -12037,7 +14060,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("bps") + * JsonValue.from("bulk_bps") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -12157,7 +14180,7 @@ private constructor( } /** - * Returns an immutable instance of [Bps]. + * Returns an immutable instance of [BulkBps]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -12166,7 +14189,7 @@ private constructor( * .id() * .billableMetric() * .billingCycleConfiguration() - * .bpsConfig() + * .bulkBpsConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -12191,12 +14214,12 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Bps = - Bps( + fun build(): BulkBps = + BulkBps( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), - checkRequired("bpsConfig", bpsConfig), + checkRequired("bulkBpsConfig", bulkBpsConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("conversionRateConfig", conversionRateConfig), @@ -12225,7 +14248,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Bps = apply { + fun validate(): BulkBps = apply { if (validated) { return@apply } @@ -12233,7 +14256,7 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() - bpsConfig().validate() + bulkBpsConfig().validate() cadence().validate() conversionRate() conversionRateConfig().ifPresent { it.validate() } @@ -12251,7 +14274,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("bps")) { + if (it != JsonValue.from("bulk_bps")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -12282,7 +14305,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + - (bpsConfig.asKnown().getOrNull()?.validity() ?: 0) + + (bulkBpsConfig.asKnown().getOrNull()?.validity() ?: 0) + (cadence.asKnown().getOrNull()?.validity() ?: 0) + (if (conversionRate.asKnown().isPresent) 1 else 0) + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + @@ -12299,7 +14322,7 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("bps")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("bulk_bps")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + @@ -12883,25 +14906,25 @@ private constructor( return true } - return /* spotless:off */ other is Bps && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bpsConfig == other.bpsConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BulkBps && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkBpsConfig == other.bulkBpsConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bpsConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkBpsConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Bps{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bpsConfig=$bpsConfig, cadence=$cadence, 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}" + "BulkBps{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkBpsConfig=$bulkBpsConfig, cadence=$cadence, 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}" } - class BulkBps + class Bulk private constructor( private val id: JsonField, private val billableMetric: JsonField, private val billingCycleConfiguration: JsonField, - private val bulkBpsConfig: JsonField, + private val bulkConfig: JsonField, private val cadence: JsonField, private val conversionRate: JsonField, private val conversionRateConfig: JsonField, @@ -12936,9 +14959,9 @@ private constructor( @JsonProperty("billing_cycle_configuration") @ExcludeMissing billingCycleConfiguration: JsonField = JsonMissing.of(), - @JsonProperty("bulk_bps_config") + @JsonProperty("bulk_config") @ExcludeMissing - bulkBpsConfig: JsonField = JsonMissing.of(), + bulkConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), @JsonProperty("conversion_rate") @ExcludeMissing @@ -12998,7 +15021,7 @@ private constructor( id, billableMetric, billingCycleConfiguration, - bulkBpsConfig, + bulkConfig, cadence, conversionRate, conversionRateConfig, @@ -13048,7 +15071,7 @@ private constructor( * @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 bulkBpsConfig(): BulkBpsConfig = bulkBpsConfig.getRequired("bulk_bps_config") + fun bulkConfig(): BulkConfig = bulkConfig.getRequired("bulk_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type or is @@ -13160,7 +15183,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("bulk_bps") + * JsonValue.from("bulk") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -13231,14 +15254,13 @@ private constructor( billingCycleConfiguration /** - * Returns the raw JSON value of [bulkBpsConfig]. + * Returns the raw JSON value of [bulkConfig]. * - * Unlike [bulkBpsConfig], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [bulkConfig], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("bulk_bps_config") + @JsonProperty("bulk_config") @ExcludeMissing - fun _bulkBpsConfig(): JsonField = bulkBpsConfig + fun _bulkConfig(): JsonField = bulkConfig /** * Returns the raw JSON value of [cadence]. @@ -13452,14 +15474,14 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [BulkBps]. + * Returns a mutable builder for constructing an instance of [Bulk]. * * The following fields are required: * ```java * .id() * .billableMetric() * .billingCycleConfiguration() - * .bulkBpsConfig() + * .bulkConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -13485,13 +15507,13 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BulkBps]. */ + /** A builder for [Bulk]. */ class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null - private var bulkBpsConfig: JsonField? = null + private var bulkConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var conversionRateConfig: JsonField? = null @@ -13508,7 +15530,7 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("bulk_bps") + private var modelType: JsonValue = JsonValue.from("bulk") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -13518,34 +15540,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bulkBps: BulkBps) = apply { - id = bulkBps.id - billableMetric = bulkBps.billableMetric - billingCycleConfiguration = bulkBps.billingCycleConfiguration - bulkBpsConfig = bulkBps.bulkBpsConfig - cadence = bulkBps.cadence - conversionRate = bulkBps.conversionRate - conversionRateConfig = bulkBps.conversionRateConfig - createdAt = bulkBps.createdAt - creditAllocation = bulkBps.creditAllocation - currency = bulkBps.currency - discount = bulkBps.discount - externalPriceId = bulkBps.externalPriceId - fixedPriceQuantity = bulkBps.fixedPriceQuantity - invoicingCycleConfiguration = bulkBps.invoicingCycleConfiguration - item = bulkBps.item - maximum = bulkBps.maximum - maximumAmount = bulkBps.maximumAmount - metadata = bulkBps.metadata - minimum = bulkBps.minimum - minimumAmount = bulkBps.minimumAmount - modelType = bulkBps.modelType - name = bulkBps.name - planPhaseOrder = bulkBps.planPhaseOrder - priceType = bulkBps.priceType - replacesPriceId = bulkBps.replacesPriceId - dimensionalPriceConfiguration = bulkBps.dimensionalPriceConfiguration - additionalProperties = bulkBps.additionalProperties.toMutableMap() + internal fun from(bulk: Bulk) = apply { + id = bulk.id + billableMetric = bulk.billableMetric + billingCycleConfiguration = bulk.billingCycleConfiguration + bulkConfig = bulk.bulkConfig + cadence = bulk.cadence + conversionRate = bulk.conversionRate + conversionRateConfig = bulk.conversionRateConfig + createdAt = bulk.createdAt + creditAllocation = bulk.creditAllocation + currency = bulk.currency + discount = bulk.discount + externalPriceId = bulk.externalPriceId + fixedPriceQuantity = bulk.fixedPriceQuantity + invoicingCycleConfiguration = bulk.invoicingCycleConfiguration + item = bulk.item + maximum = bulk.maximum + maximumAmount = bulk.maximumAmount + metadata = bulk.metadata + minimum = bulk.minimum + minimumAmount = bulk.minimumAmount + modelType = bulk.modelType + name = bulk.name + planPhaseOrder = bulk.planPhaseOrder + priceType = bulk.priceType + replacesPriceId = bulk.replacesPriceId + dimensionalPriceConfiguration = bulk.dimensionalPriceConfiguration + additionalProperties = bulk.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -13591,18 +15613,17 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } - fun bulkBpsConfig(bulkBpsConfig: BulkBpsConfig) = - bulkBpsConfig(JsonField.of(bulkBpsConfig)) + fun bulkConfig(bulkConfig: BulkConfig) = bulkConfig(JsonField.of(bulkConfig)) /** - * Sets [Builder.bulkBpsConfig] to an arbitrary JSON value. + * Sets [Builder.bulkConfig] to an arbitrary JSON value. * - * You should usually call [Builder.bulkBpsConfig] with a well-typed [BulkBpsConfig] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * You should usually call [Builder.bulkConfig] with a well-typed [BulkConfig] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun bulkBpsConfig(bulkBpsConfig: JsonField) = apply { - this.bulkBpsConfig = bulkBpsConfig + fun bulkConfig(bulkConfig: JsonField) = apply { + this.bulkConfig = bulkConfig } fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -14021,7 +16042,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("bulk_bps") + * JsonValue.from("bulk") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -14141,7 +16162,7 @@ private constructor( } /** - * Returns an immutable instance of [BulkBps]. + * Returns an immutable instance of [Bulk]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -14150,7 +16171,7 @@ private constructor( * .id() * .billableMetric() * .billingCycleConfiguration() - * .bulkBpsConfig() + * .bulkConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -14175,12 +16196,12 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BulkBps = - BulkBps( + fun build(): Bulk = + Bulk( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), - checkRequired("bulkBpsConfig", bulkBpsConfig), + checkRequired("bulkConfig", bulkConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("conversionRateConfig", conversionRateConfig), @@ -14209,7 +16230,7 @@ private constructor( private var validated: Boolean = false - fun validate(): BulkBps = apply { + fun validate(): Bulk = apply { if (validated) { return@apply } @@ -14217,7 +16238,7 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() - bulkBpsConfig().validate() + bulkConfig().validate() cadence().validate() conversionRate() conversionRateConfig().ifPresent { it.validate() } @@ -14235,7 +16256,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("bulk_bps")) { + if (it != JsonValue.from("bulk")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -14266,7 +16287,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + - (bulkBpsConfig.asKnown().getOrNull()?.validity() ?: 0) + + (bulkConfig.asKnown().getOrNull()?.validity() ?: 0) + (cadence.asKnown().getOrNull()?.validity() ?: 0) + (if (conversionRate.asKnown().isPresent) 1 else 0) + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + @@ -14283,7 +16304,7 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("bulk_bps")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("bulk")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + @@ -14867,25 +16888,24 @@ private constructor( return true } - return /* spotless:off */ other is BulkBps && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkBpsConfig == other.bulkBpsConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Bulk && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkConfig == other.bulkConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkBpsConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BulkBps{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkBpsConfig=$bulkBpsConfig, cadence=$cadence, 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, bulkConfig=$bulkConfig, cadence=$cadence, 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}" } - class Bulk + class ThresholdTotalAmount private constructor( private val id: JsonField, private val billableMetric: JsonField, private val billingCycleConfiguration: JsonField, - private val bulkConfig: JsonField, private val cadence: JsonField, private val conversionRate: JsonField, private val conversionRateConfig: JsonField, @@ -14907,6 +16927,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, + private val thresholdTotalAmountConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -14920,9 +16941,6 @@ private constructor( @JsonProperty("billing_cycle_configuration") @ExcludeMissing billingCycleConfiguration: JsonField = JsonMissing.of(), - @JsonProperty("bulk_config") - @ExcludeMissing - bulkConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), @JsonProperty("conversion_rate") @ExcludeMissing @@ -14974,6 +16992,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("threshold_total_amount_config") + @ExcludeMissing + thresholdTotalAmountConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -14982,7 +17003,6 @@ private constructor( id, billableMetric, billingCycleConfiguration, - bulkConfig, cadence, conversionRate, conversionRateConfig, @@ -15004,6 +17024,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, + thresholdTotalAmountConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -15028,12 +17049,6 @@ private constructor( fun billingCycleConfiguration(): BillingCycleConfiguration = billingCycleConfiguration.getRequired("billing_cycle_configuration") - /** - * @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 bulkConfig(): BulkConfig = bulkConfig.getRequired("bulk_config") - /** * @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). @@ -15144,7 +17159,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("bulk") + * JsonValue.from("threshold_total_amount") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -15179,6 +17194,13 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 thresholdTotalAmountConfig(): ThresholdTotalAmountConfig = + thresholdTotalAmountConfig.getRequired("threshold_total_amount_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -15214,15 +17236,6 @@ private constructor( fun _billingCycleConfiguration(): JsonField = billingCycleConfiguration - /** - * Returns the raw JSON value of [bulkConfig]. - * - * Unlike [bulkConfig], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("bulk_config") - @ExcludeMissing - fun _bulkConfig(): JsonField = bulkConfig - /** * Returns the raw JSON value of [cadence]. * @@ -15409,6 +17422,17 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId + /** + * Returns the raw JSON value of [thresholdTotalAmountConfig]. + * + * Unlike [thresholdTotalAmountConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("threshold_total_amount_config") + @ExcludeMissing + fun _thresholdTotalAmountConfig(): JsonField = + thresholdTotalAmountConfig + /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -15435,14 +17459,13 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Bulk]. + * Returns a mutable builder for constructing an instance of [ThresholdTotalAmount]. * * The following fields are required: * ```java * .id() * .billableMetric() * .billingCycleConfiguration() - * .bulkConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -15463,18 +17486,18 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .thresholdTotalAmountConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Bulk]. */ + /** A builder for [ThresholdTotalAmount]. */ class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null - private var bulkConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var conversionRateConfig: JsonField? = null @@ -15491,44 +17514,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("bulk") + private var modelType: JsonValue = JsonValue.from("threshold_total_amount") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null + private var thresholdTotalAmountConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bulk: Bulk) = apply { - id = bulk.id - billableMetric = bulk.billableMetric - billingCycleConfiguration = bulk.billingCycleConfiguration - bulkConfig = bulk.bulkConfig - cadence = bulk.cadence - conversionRate = bulk.conversionRate - conversionRateConfig = bulk.conversionRateConfig - createdAt = bulk.createdAt - creditAllocation = bulk.creditAllocation - currency = bulk.currency - discount = bulk.discount - externalPriceId = bulk.externalPriceId - fixedPriceQuantity = bulk.fixedPriceQuantity - invoicingCycleConfiguration = bulk.invoicingCycleConfiguration - item = bulk.item - maximum = bulk.maximum - maximumAmount = bulk.maximumAmount - metadata = bulk.metadata - minimum = bulk.minimum - minimumAmount = bulk.minimumAmount - modelType = bulk.modelType - name = bulk.name - planPhaseOrder = bulk.planPhaseOrder - priceType = bulk.priceType - replacesPriceId = bulk.replacesPriceId - dimensionalPriceConfiguration = bulk.dimensionalPriceConfiguration - additionalProperties = bulk.additionalProperties.toMutableMap() + internal fun from(thresholdTotalAmount: ThresholdTotalAmount) = apply { + id = thresholdTotalAmount.id + billableMetric = thresholdTotalAmount.billableMetric + billingCycleConfiguration = thresholdTotalAmount.billingCycleConfiguration + cadence = thresholdTotalAmount.cadence + conversionRate = thresholdTotalAmount.conversionRate + conversionRateConfig = thresholdTotalAmount.conversionRateConfig + createdAt = thresholdTotalAmount.createdAt + creditAllocation = thresholdTotalAmount.creditAllocation + currency = thresholdTotalAmount.currency + discount = thresholdTotalAmount.discount + externalPriceId = thresholdTotalAmount.externalPriceId + fixedPriceQuantity = thresholdTotalAmount.fixedPriceQuantity + invoicingCycleConfiguration = thresholdTotalAmount.invoicingCycleConfiguration + item = thresholdTotalAmount.item + maximum = thresholdTotalAmount.maximum + maximumAmount = thresholdTotalAmount.maximumAmount + metadata = thresholdTotalAmount.metadata + minimum = thresholdTotalAmount.minimum + minimumAmount = thresholdTotalAmount.minimumAmount + modelType = thresholdTotalAmount.modelType + name = thresholdTotalAmount.name + planPhaseOrder = thresholdTotalAmount.planPhaseOrder + priceType = thresholdTotalAmount.priceType + replacesPriceId = thresholdTotalAmount.replacesPriceId + thresholdTotalAmountConfig = thresholdTotalAmount.thresholdTotalAmountConfig + dimensionalPriceConfiguration = thresholdTotalAmount.dimensionalPriceConfiguration + additionalProperties = thresholdTotalAmount.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -15574,19 +17598,6 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } - fun bulkConfig(bulkConfig: BulkConfig) = bulkConfig(JsonField.of(bulkConfig)) - - /** - * Sets [Builder.bulkConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.bulkConfig] with a well-typed [BulkConfig] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun bulkConfig(bulkConfig: JsonField) = apply { - this.bulkConfig = bulkConfig - } - fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) /** @@ -16003,7 +18014,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("bulk") + * JsonValue.from("threshold_total_amount") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -16080,6 +18091,20 @@ private constructor( this.replacesPriceId = replacesPriceId } + fun thresholdTotalAmountConfig(thresholdTotalAmountConfig: ThresholdTotalAmountConfig) = + thresholdTotalAmountConfig(JsonField.of(thresholdTotalAmountConfig)) + + /** + * Sets [Builder.thresholdTotalAmountConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.thresholdTotalAmountConfig] with a well-typed + * [ThresholdTotalAmountConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thresholdTotalAmountConfig( + thresholdTotalAmountConfig: JsonField + ) = apply { this.thresholdTotalAmountConfig = thresholdTotalAmountConfig } + fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -16123,7 +18148,7 @@ private constructor( } /** - * Returns an immutable instance of [Bulk]. + * Returns an immutable instance of [ThresholdTotalAmount]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -16132,7 +18157,6 @@ private constructor( * .id() * .billableMetric() * .billingCycleConfiguration() - * .bulkConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -16153,16 +18177,16 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .thresholdTotalAmountConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Bulk = - Bulk( + fun build(): ThresholdTotalAmount = + ThresholdTotalAmount( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), - checkRequired("bulkConfig", bulkConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("conversionRateConfig", conversionRateConfig), @@ -16184,6 +18208,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), + checkRequired("thresholdTotalAmountConfig", thresholdTotalAmountConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -16191,7 +18216,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Bulk = apply { + fun validate(): ThresholdTotalAmount = apply { if (validated) { return@apply } @@ -16199,7 +18224,6 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() - bulkConfig().validate() cadence().validate() conversionRate() conversionRateConfig().ifPresent { it.validate() } @@ -16217,7 +18241,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("bulk")) { + if (it != JsonValue.from("threshold_total_amount")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -16225,6 +18249,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() + thresholdTotalAmountConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -16248,7 +18273,6 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + - (bulkConfig.asKnown().getOrNull()?.validity() ?: 0) + (cadence.asKnown().getOrNull()?.validity() ?: 0) + (if (conversionRate.asKnown().isPresent) 1 else 0) + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + @@ -16265,11 +18289,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("bulk")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("threshold_total_amount")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (thresholdTotalAmountConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -16844,25 +18869,135 @@ private constructor( override fun toString() = value.toString() } + class ThresholdTotalAmountConfig + @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 + * [ThresholdTotalAmountConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thresholdTotalAmountConfig: ThresholdTotalAmountConfig) = apply { + additionalProperties = + thresholdTotalAmountConfig.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 [ThresholdTotalAmountConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ThresholdTotalAmountConfig = + ThresholdTotalAmountConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): ThresholdTotalAmountConfig = 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 /* spotless:off */ other is ThresholdTotalAmountConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThresholdTotalAmountConfig{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Bulk && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkConfig == other.bulkConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ThresholdTotalAmount && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && thresholdTotalAmountConfig == other.thresholdTotalAmountConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, thresholdTotalAmountConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Bulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkConfig=$bulkConfig, cadence=$cadence, 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}" + "ThresholdTotalAmount{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class ThresholdTotalAmount + class TieredPackage private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -16888,7 +19023,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val thresholdTotalAmountConfig: JsonField, + private val tieredPackageConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -16953,9 +19088,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("threshold_total_amount_config") + @JsonProperty("tiered_package_config") @ExcludeMissing - thresholdTotalAmountConfig: JsonField = JsonMissing.of(), + tieredPackageConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -16985,7 +19120,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - thresholdTotalAmountConfig, + tieredPackageConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -17120,7 +19255,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("threshold_total_amount") + * JsonValue.from("tiered_package") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -17159,8 +19294,8 @@ private constructor( * @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 thresholdTotalAmountConfig(): ThresholdTotalAmountConfig = - thresholdTotalAmountConfig.getRequired("threshold_total_amount_config") + fun tieredPackageConfig(): TieredPackageConfig = + tieredPackageConfig.getRequired("tiered_package_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -17384,15 +19519,14 @@ private constructor( fun _replacesPriceId(): JsonField = replacesPriceId /** - * Returns the raw JSON value of [thresholdTotalAmountConfig]. + * Returns the raw JSON value of [tieredPackageConfig]. * - * Unlike [thresholdTotalAmountConfig], this method doesn't throw if the JSON field has an + * Unlike [tieredPackageConfig], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("threshold_total_amount_config") + @JsonProperty("tiered_package_config") @ExcludeMissing - fun _thresholdTotalAmountConfig(): JsonField = - thresholdTotalAmountConfig + fun _tieredPackageConfig(): JsonField = tieredPackageConfig /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. @@ -17420,7 +19554,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ThresholdTotalAmount]. + * Returns a mutable builder for constructing an instance of [TieredPackage]. * * The following fields are required: * ```java @@ -17447,13 +19581,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .thresholdTotalAmountConfig() + * .tieredPackageConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [ThresholdTotalAmount]. */ + /** A builder for [TieredPackage]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -17475,45 +19609,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("threshold_total_amount") + private var modelType: JsonValue = JsonValue.from("tiered_package") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var thresholdTotalAmountConfig: JsonField? = null + private var tieredPackageConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(thresholdTotalAmount: ThresholdTotalAmount) = apply { - id = thresholdTotalAmount.id - billableMetric = thresholdTotalAmount.billableMetric - billingCycleConfiguration = thresholdTotalAmount.billingCycleConfiguration - cadence = thresholdTotalAmount.cadence - conversionRate = thresholdTotalAmount.conversionRate - conversionRateConfig = thresholdTotalAmount.conversionRateConfig - createdAt = thresholdTotalAmount.createdAt - creditAllocation = thresholdTotalAmount.creditAllocation - currency = thresholdTotalAmount.currency - discount = thresholdTotalAmount.discount - externalPriceId = thresholdTotalAmount.externalPriceId - fixedPriceQuantity = thresholdTotalAmount.fixedPriceQuantity - invoicingCycleConfiguration = thresholdTotalAmount.invoicingCycleConfiguration - item = thresholdTotalAmount.item - maximum = thresholdTotalAmount.maximum - maximumAmount = thresholdTotalAmount.maximumAmount - metadata = thresholdTotalAmount.metadata - minimum = thresholdTotalAmount.minimum - minimumAmount = thresholdTotalAmount.minimumAmount - modelType = thresholdTotalAmount.modelType - name = thresholdTotalAmount.name - planPhaseOrder = thresholdTotalAmount.planPhaseOrder - priceType = thresholdTotalAmount.priceType - replacesPriceId = thresholdTotalAmount.replacesPriceId - thresholdTotalAmountConfig = thresholdTotalAmount.thresholdTotalAmountConfig - dimensionalPriceConfiguration = thresholdTotalAmount.dimensionalPriceConfiguration - additionalProperties = thresholdTotalAmount.additionalProperties.toMutableMap() + internal fun from(tieredPackage: TieredPackage) = apply { + id = tieredPackage.id + billableMetric = tieredPackage.billableMetric + billingCycleConfiguration = tieredPackage.billingCycleConfiguration + cadence = tieredPackage.cadence + conversionRate = tieredPackage.conversionRate + conversionRateConfig = tieredPackage.conversionRateConfig + createdAt = tieredPackage.createdAt + creditAllocation = tieredPackage.creditAllocation + currency = tieredPackage.currency + discount = tieredPackage.discount + externalPriceId = tieredPackage.externalPriceId + fixedPriceQuantity = tieredPackage.fixedPriceQuantity + invoicingCycleConfiguration = tieredPackage.invoicingCycleConfiguration + item = tieredPackage.item + maximum = tieredPackage.maximum + maximumAmount = tieredPackage.maximumAmount + metadata = tieredPackage.metadata + minimum = tieredPackage.minimum + minimumAmount = tieredPackage.minimumAmount + modelType = tieredPackage.modelType + name = tieredPackage.name + planPhaseOrder = tieredPackage.planPhaseOrder + priceType = tieredPackage.priceType + replacesPriceId = tieredPackage.replacesPriceId + tieredPackageConfig = tieredPackage.tieredPackageConfig + dimensionalPriceConfiguration = tieredPackage.dimensionalPriceConfiguration + additionalProperties = tieredPackage.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -17975,7 +20109,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("threshold_total_amount") + * JsonValue.from("tiered_package") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -18052,19 +20186,19 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun thresholdTotalAmountConfig(thresholdTotalAmountConfig: ThresholdTotalAmountConfig) = - thresholdTotalAmountConfig(JsonField.of(thresholdTotalAmountConfig)) + fun tieredPackageConfig(tieredPackageConfig: TieredPackageConfig) = + tieredPackageConfig(JsonField.of(tieredPackageConfig)) /** - * Sets [Builder.thresholdTotalAmountConfig] to an arbitrary JSON value. + * Sets [Builder.tieredPackageConfig] to an arbitrary JSON value. * - * You should usually call [Builder.thresholdTotalAmountConfig] with a well-typed - * [ThresholdTotalAmountConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. + * You should usually call [Builder.tieredPackageConfig] with a well-typed + * [TieredPackageConfig] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. */ - fun thresholdTotalAmountConfig( - thresholdTotalAmountConfig: JsonField - ) = apply { this.thresholdTotalAmountConfig = thresholdTotalAmountConfig } + fun tieredPackageConfig(tieredPackageConfig: JsonField) = apply { + this.tieredPackageConfig = tieredPackageConfig + } fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? @@ -18109,7 +20243,7 @@ private constructor( } /** - * Returns an immutable instance of [ThresholdTotalAmount]. + * Returns an immutable instance of [TieredPackage]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -18138,13 +20272,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .thresholdTotalAmountConfig() + * .tieredPackageConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): ThresholdTotalAmount = - ThresholdTotalAmount( + fun build(): TieredPackage = + TieredPackage( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -18169,7 +20303,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("thresholdTotalAmountConfig", thresholdTotalAmountConfig), + checkRequired("tieredPackageConfig", tieredPackageConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -18177,7 +20311,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ThresholdTotalAmount = apply { + fun validate(): TieredPackage = apply { if (validated) { return@apply } @@ -18202,7 +20336,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("threshold_total_amount")) { + if (it != JsonValue.from("tiered_package")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -18210,7 +20344,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - thresholdTotalAmountConfig().validate() + tieredPackageConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -18250,12 +20384,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("threshold_total_amount")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("tiered_package")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (thresholdTotalAmountConfig.asKnown().getOrNull()?.validity() ?: 0) + + (tieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -18830,7 +20964,7 @@ private constructor( override fun toString() = value.toString() } - class ThresholdTotalAmountConfig + class TieredPackageConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -18846,21 +20980,19 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [ThresholdTotalAmountConfig]. + * Returns a mutable builder for constructing an instance of [TieredPackageConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [ThresholdTotalAmountConfig]. */ + /** A builder for [TieredPackageConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(thresholdTotalAmountConfig: ThresholdTotalAmountConfig) = apply { - additionalProperties = - thresholdTotalAmountConfig.additionalProperties.toMutableMap() + internal fun from(tieredPackageConfig: TieredPackageConfig) = apply { + additionalProperties = tieredPackageConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -18886,17 +21018,17 @@ private constructor( } /** - * Returns an immutable instance of [ThresholdTotalAmountConfig]. + * Returns an immutable instance of [TieredPackageConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): ThresholdTotalAmountConfig = - ThresholdTotalAmountConfig(additionalProperties.toImmutable()) + fun build(): TieredPackageConfig = + TieredPackageConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): ThresholdTotalAmountConfig = apply { + fun validate(): TieredPackageConfig = apply { if (validated) { return@apply } @@ -18927,7 +21059,7 @@ private constructor( return true } - return /* spotless:off */ other is ThresholdTotalAmountConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -18937,7 +21069,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ThresholdTotalAmountConfig{additionalProperties=$additionalProperties}" + "TieredPackageConfig{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -18945,20 +21077,20 @@ private constructor( return true } - return /* spotless:off */ other is ThresholdTotalAmount && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && thresholdTotalAmountConfig == other.thresholdTotalAmountConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackage && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredPackageConfig == other.tieredPackageConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, thresholdTotalAmountConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredPackageConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ThresholdTotalAmount{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "TieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class TieredPackage + class GroupedTiered private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -18972,6 +21104,7 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, + private val groupedTieredConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -18984,7 +21117,6 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val tieredPackageConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -19023,6 +21155,9 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("grouped_tiered_config") + @ExcludeMissing + groupedTieredConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @@ -19049,9 +21184,6 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("tiered_package_config") - @ExcludeMissing - tieredPackageConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -19069,6 +21201,7 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, + groupedTieredConfig, invoicingCycleConfiguration, item, maximum, @@ -19081,7 +21214,6 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - tieredPackageConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -19164,6 +21296,13 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") + /** + * @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 groupedTieredConfig(): GroupedTieredConfig = + groupedTieredConfig.getRequired("grouped_tiered_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -19216,7 +21355,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("tiered_package") + * JsonValue.from("grouped_tiered") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -19251,13 +21390,6 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 tieredPackageConfig(): TieredPackageConfig = - tieredPackageConfig.getRequired("tiered_package_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -19376,6 +21508,16 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + /** + * Returns the raw JSON value of [groupedTieredConfig]. + * + * Unlike [groupedTieredConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("grouped_tiered_config") + @ExcludeMissing + fun _groupedTieredConfig(): JsonField = groupedTieredConfig + /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -19479,16 +21621,6 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId - /** - * Returns the raw JSON value of [tieredPackageConfig]. - * - * Unlike [tieredPackageConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("tiered_package_config") - @ExcludeMissing - fun _tieredPackageConfig(): JsonField = tieredPackageConfig - /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -19515,7 +21647,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [TieredPackage]. + * Returns a mutable builder for constructing an instance of [GroupedTiered]. * * The following fields are required: * ```java @@ -19531,6 +21663,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedTieredConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -19542,13 +21675,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredPackageConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredPackage]. */ + /** A builder for [GroupedTiered]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -19563,6 +21695,7 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null + private var groupedTieredConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -19570,45 +21703,44 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("tiered_package") + private var modelType: JsonValue = JsonValue.from("grouped_tiered") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var tieredPackageConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredPackage: TieredPackage) = apply { - id = tieredPackage.id - billableMetric = tieredPackage.billableMetric - billingCycleConfiguration = tieredPackage.billingCycleConfiguration - cadence = tieredPackage.cadence - conversionRate = tieredPackage.conversionRate - conversionRateConfig = tieredPackage.conversionRateConfig - createdAt = tieredPackage.createdAt - creditAllocation = tieredPackage.creditAllocation - currency = tieredPackage.currency - discount = tieredPackage.discount - externalPriceId = tieredPackage.externalPriceId - fixedPriceQuantity = tieredPackage.fixedPriceQuantity - invoicingCycleConfiguration = tieredPackage.invoicingCycleConfiguration - item = tieredPackage.item - maximum = tieredPackage.maximum - maximumAmount = tieredPackage.maximumAmount - metadata = tieredPackage.metadata - minimum = tieredPackage.minimum - minimumAmount = tieredPackage.minimumAmount - modelType = tieredPackage.modelType - name = tieredPackage.name - planPhaseOrder = tieredPackage.planPhaseOrder - priceType = tieredPackage.priceType - replacesPriceId = tieredPackage.replacesPriceId - tieredPackageConfig = tieredPackage.tieredPackageConfig - dimensionalPriceConfiguration = tieredPackage.dimensionalPriceConfiguration - additionalProperties = tieredPackage.additionalProperties.toMutableMap() + internal fun from(groupedTiered: GroupedTiered) = apply { + id = groupedTiered.id + billableMetric = groupedTiered.billableMetric + billingCycleConfiguration = groupedTiered.billingCycleConfiguration + cadence = groupedTiered.cadence + conversionRate = groupedTiered.conversionRate + conversionRateConfig = groupedTiered.conversionRateConfig + createdAt = groupedTiered.createdAt + creditAllocation = groupedTiered.creditAllocation + currency = groupedTiered.currency + discount = groupedTiered.discount + externalPriceId = groupedTiered.externalPriceId + fixedPriceQuantity = groupedTiered.fixedPriceQuantity + groupedTieredConfig = groupedTiered.groupedTieredConfig + invoicingCycleConfiguration = groupedTiered.invoicingCycleConfiguration + item = groupedTiered.item + maximum = groupedTiered.maximum + maximumAmount = groupedTiered.maximumAmount + metadata = groupedTiered.metadata + minimum = groupedTiered.minimum + minimumAmount = groupedTiered.minimumAmount + modelType = groupedTiered.modelType + name = groupedTiered.name + planPhaseOrder = groupedTiered.planPhaseOrder + priceType = groupedTiered.priceType + replacesPriceId = groupedTiered.replacesPriceId + dimensionalPriceConfiguration = groupedTiered.dimensionalPriceConfiguration + additionalProperties = groupedTiered.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -19938,6 +22070,20 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } + fun groupedTieredConfig(groupedTieredConfig: GroupedTieredConfig) = + groupedTieredConfig(JsonField.of(groupedTieredConfig)) + + /** + * Sets [Builder.groupedTieredConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.groupedTieredConfig] with a well-typed + * [GroupedTieredConfig] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun groupedTieredConfig(groupedTieredConfig: JsonField) = apply { + this.groupedTieredConfig = groupedTieredConfig + } + fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -20070,7 +22216,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("tiered_package") + * JsonValue.from("grouped_tiered") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -20147,20 +22293,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun tieredPackageConfig(tieredPackageConfig: TieredPackageConfig) = - tieredPackageConfig(JsonField.of(tieredPackageConfig)) - - /** - * Sets [Builder.tieredPackageConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.tieredPackageConfig] with a well-typed - * [TieredPackageConfig] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun tieredPackageConfig(tieredPackageConfig: JsonField) = apply { - this.tieredPackageConfig = tieredPackageConfig - } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -20204,7 +22336,7 @@ private constructor( } /** - * Returns an immutable instance of [TieredPackage]. + * Returns an immutable instance of [GroupedTiered]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -20222,6 +22354,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedTieredConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -20233,13 +22366,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredPackageConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): TieredPackage = - TieredPackage( + fun build(): GroupedTiered = + GroupedTiered( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -20252,6 +22384,7 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired("groupedTieredConfig", groupedTieredConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -20264,7 +22397,6 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("tieredPackageConfig", tieredPackageConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -20272,7 +22404,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TieredPackage = apply { + fun validate(): GroupedTiered = apply { if (validated) { return@apply } @@ -20289,6 +22421,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() + groupedTieredConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -20297,7 +22430,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("tiered_package")) { + if (it != JsonValue.from("grouped_tiered")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -20305,7 +22438,6 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - tieredPackageConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -20338,6 +22470,7 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + + (groupedTieredConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -20345,12 +22478,11 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("tiered_package")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("grouped_tiered")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (tieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -20687,6 +22819,114 @@ private constructor( } } + class GroupedTieredConfig + @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 [GroupedTieredConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [GroupedTieredConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(groupedTieredConfig: GroupedTieredConfig) = apply { + additionalProperties = groupedTieredConfig.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 [GroupedTieredConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): GroupedTieredConfig = + GroupedTieredConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): GroupedTieredConfig = 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 /* spotless:off */ other is GroupedTieredConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GroupedTieredConfig{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 @@ -20925,133 +23165,25 @@ private constructor( override fun toString() = value.toString() } - class TieredPackageConfig - @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 [TieredPackageConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [TieredPackageConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(tieredPackageConfig: TieredPackageConfig) = apply { - additionalProperties = tieredPackageConfig.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 [TieredPackageConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): TieredPackageConfig = - TieredPackageConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): TieredPackageConfig = 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 /* spotless:off */ other is TieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "TieredPackageConfig{additionalProperties=$additionalProperties}" - } - override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredPackage && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredPackageConfig == other.tieredPackageConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedTiered && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedTieredConfig == other.groupedTieredConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredPackageConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedTieredConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "GroupedTiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class GroupedTiered + class TieredWithMinimum private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -21065,7 +23197,6 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, - private val groupedTieredConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -21078,6 +23209,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, + private val tieredWithMinimumConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -21116,9 +23248,6 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_tiered_config") - @ExcludeMissing - groupedTieredConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @@ -21145,6 +23274,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("tiered_with_minimum_config") + @ExcludeMissing + tieredWithMinimumConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -21162,7 +23294,6 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, - groupedTieredConfig, invoicingCycleConfiguration, item, maximum, @@ -21175,6 +23306,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, + tieredWithMinimumConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -21257,13 +23389,6 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") - /** - * @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 groupedTieredConfig(): GroupedTieredConfig = - groupedTieredConfig.getRequired("grouped_tiered_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -21316,7 +23441,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("grouped_tiered") + * JsonValue.from("tiered_with_minimum") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -21351,6 +23476,13 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 tieredWithMinimumConfig(): TieredWithMinimumConfig = + tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -21469,16 +23601,6 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - /** - * Returns the raw JSON value of [groupedTieredConfig]. - * - * Unlike [groupedTieredConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("grouped_tiered_config") - @ExcludeMissing - fun _groupedTieredConfig(): JsonField = groupedTieredConfig - /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -21582,6 +23704,16 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId + /** + * Returns the raw JSON value of [tieredWithMinimumConfig]. + * + * Unlike [tieredWithMinimumConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("tiered_with_minimum_config") + @ExcludeMissing + fun _tieredWithMinimumConfig(): JsonField = tieredWithMinimumConfig + /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -21608,7 +23740,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [GroupedTiered]. + * Returns a mutable builder for constructing an instance of [TieredWithMinimum]. * * The following fields are required: * ```java @@ -21624,7 +23756,6 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedTieredConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -21636,12 +23767,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .tieredWithMinimumConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedTiered]. */ + /** A builder for [TieredWithMinimum]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -21656,7 +23788,6 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedTieredConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -21664,44 +23795,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("grouped_tiered") + private var modelType: JsonValue = JsonValue.from("tiered_with_minimum") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null + private var tieredWithMinimumConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedTiered: GroupedTiered) = apply { - id = groupedTiered.id - billableMetric = groupedTiered.billableMetric - billingCycleConfiguration = groupedTiered.billingCycleConfiguration - cadence = groupedTiered.cadence - conversionRate = groupedTiered.conversionRate - conversionRateConfig = groupedTiered.conversionRateConfig - createdAt = groupedTiered.createdAt - creditAllocation = groupedTiered.creditAllocation - currency = groupedTiered.currency - discount = groupedTiered.discount - externalPriceId = groupedTiered.externalPriceId - fixedPriceQuantity = groupedTiered.fixedPriceQuantity - groupedTieredConfig = groupedTiered.groupedTieredConfig - invoicingCycleConfiguration = groupedTiered.invoicingCycleConfiguration - item = groupedTiered.item - maximum = groupedTiered.maximum - maximumAmount = groupedTiered.maximumAmount - metadata = groupedTiered.metadata - minimum = groupedTiered.minimum - minimumAmount = groupedTiered.minimumAmount - modelType = groupedTiered.modelType - name = groupedTiered.name - planPhaseOrder = groupedTiered.planPhaseOrder - priceType = groupedTiered.priceType - replacesPriceId = groupedTiered.replacesPriceId - dimensionalPriceConfiguration = groupedTiered.dimensionalPriceConfiguration - additionalProperties = groupedTiered.additionalProperties.toMutableMap() + internal fun from(tieredWithMinimum: TieredWithMinimum) = apply { + id = tieredWithMinimum.id + billableMetric = tieredWithMinimum.billableMetric + billingCycleConfiguration = tieredWithMinimum.billingCycleConfiguration + cadence = tieredWithMinimum.cadence + conversionRate = tieredWithMinimum.conversionRate + conversionRateConfig = tieredWithMinimum.conversionRateConfig + createdAt = tieredWithMinimum.createdAt + creditAllocation = tieredWithMinimum.creditAllocation + currency = tieredWithMinimum.currency + discount = tieredWithMinimum.discount + externalPriceId = tieredWithMinimum.externalPriceId + fixedPriceQuantity = tieredWithMinimum.fixedPriceQuantity + invoicingCycleConfiguration = tieredWithMinimum.invoicingCycleConfiguration + item = tieredWithMinimum.item + maximum = tieredWithMinimum.maximum + maximumAmount = tieredWithMinimum.maximumAmount + metadata = tieredWithMinimum.metadata + minimum = tieredWithMinimum.minimum + minimumAmount = tieredWithMinimum.minimumAmount + modelType = tieredWithMinimum.modelType + name = tieredWithMinimum.name + planPhaseOrder = tieredWithMinimum.planPhaseOrder + priceType = tieredWithMinimum.priceType + replacesPriceId = tieredWithMinimum.replacesPriceId + tieredWithMinimumConfig = tieredWithMinimum.tieredWithMinimumConfig + dimensionalPriceConfiguration = tieredWithMinimum.dimensionalPriceConfiguration + additionalProperties = tieredWithMinimum.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -22031,20 +24163,6 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedTieredConfig(groupedTieredConfig: GroupedTieredConfig) = - groupedTieredConfig(JsonField.of(groupedTieredConfig)) - - /** - * Sets [Builder.groupedTieredConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.groupedTieredConfig] with a well-typed - * [GroupedTieredConfig] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun groupedTieredConfig(groupedTieredConfig: JsonField) = apply { - this.groupedTieredConfig = groupedTieredConfig - } - fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -22177,7 +24295,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("grouped_tiered") + * JsonValue.from("tiered_with_minimum") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -22254,6 +24372,20 @@ private constructor( this.replacesPriceId = replacesPriceId } + fun tieredWithMinimumConfig(tieredWithMinimumConfig: TieredWithMinimumConfig) = + tieredWithMinimumConfig(JsonField.of(tieredWithMinimumConfig)) + + /** + * Sets [Builder.tieredWithMinimumConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.tieredWithMinimumConfig] with a well-typed + * [TieredWithMinimumConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun tieredWithMinimumConfig( + tieredWithMinimumConfig: JsonField + ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -22297,7 +24429,7 @@ private constructor( } /** - * Returns an immutable instance of [GroupedTiered]. + * Returns an immutable instance of [TieredWithMinimum]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -22315,7 +24447,6 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedTieredConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -22327,12 +24458,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .tieredWithMinimumConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): GroupedTiered = - GroupedTiered( + fun build(): TieredWithMinimum = + TieredWithMinimum( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -22345,7 +24477,6 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("groupedTieredConfig", groupedTieredConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -22358,6 +24489,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), + checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -22365,7 +24497,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedTiered = apply { + fun validate(): TieredWithMinimum = apply { if (validated) { return@apply } @@ -22382,7 +24514,6 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedTieredConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -22391,7 +24522,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("grouped_tiered")) { + if (it != JsonValue.from("tiered_with_minimum")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -22399,6 +24530,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() + tieredWithMinimumConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -22431,7 +24563,6 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + - (groupedTieredConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -22439,11 +24570,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("grouped_tiered")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("tiered_with_minimum")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (tieredWithMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -22780,114 +24912,6 @@ private constructor( } } - class GroupedTieredConfig - @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 [GroupedTieredConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [GroupedTieredConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(groupedTieredConfig: GroupedTieredConfig) = apply { - additionalProperties = groupedTieredConfig.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 [GroupedTieredConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): GroupedTieredConfig = - GroupedTieredConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): GroupedTieredConfig = 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 /* spotless:off */ other is GroupedTieredConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "GroupedTieredConfig{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 @@ -23126,25 +25150,135 @@ private constructor( override fun toString() = value.toString() } + class TieredWithMinimumConfig + @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 + * [TieredWithMinimumConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(tieredWithMinimumConfig: TieredWithMinimumConfig) = apply { + additionalProperties = + tieredWithMinimumConfig.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 [TieredWithMinimumConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TieredWithMinimumConfig = + TieredWithMinimumConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): TieredWithMinimumConfig = 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 /* spotless:off */ other is TieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is GroupedTiered && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedTieredConfig == other.groupedTieredConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredWithMinimumConfig == other.tieredWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedTieredConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredWithMinimumConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTiered{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "TieredWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class TieredWithMinimum + class TieredPackageWithMinimum private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -23170,7 +25304,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val tieredWithMinimumConfig: JsonField, + private val tieredPackageWithMinimumConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -23235,9 +25369,10 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("tiered_with_minimum_config") + @JsonProperty("tiered_package_with_minimum_config") @ExcludeMissing - tieredWithMinimumConfig: JsonField = JsonMissing.of(), + tieredPackageWithMinimumConfig: JsonField = + JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -23267,7 +25402,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - tieredWithMinimumConfig, + tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -23402,7 +25537,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("tiered_with_minimum") + * JsonValue.from("tiered_package_with_minimum") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -23441,8 +25576,8 @@ private constructor( * @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 tieredWithMinimumConfig(): TieredWithMinimumConfig = - tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + fun tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = + tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -23666,14 +25801,15 @@ private constructor( fun _replacesPriceId(): JsonField = replacesPriceId /** - * Returns the raw JSON value of [tieredWithMinimumConfig]. + * Returns the raw JSON value of [tieredPackageWithMinimumConfig]. * - * Unlike [tieredWithMinimumConfig], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [tieredPackageWithMinimumConfig], this method doesn't throw if the JSON field has + * an unexpected type. */ - @JsonProperty("tiered_with_minimum_config") + @JsonProperty("tiered_package_with_minimum_config") @ExcludeMissing - fun _tieredWithMinimumConfig(): JsonField = tieredWithMinimumConfig + fun _tieredPackageWithMinimumConfig(): JsonField = + tieredPackageWithMinimumConfig /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. @@ -23701,7 +25837,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [TieredWithMinimum]. + * Returns a mutable builder for constructing an instance of [TieredPackageWithMinimum]. * * The following fields are required: * ```java @@ -23728,13 +25864,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredWithMinimumConfig() + * .tieredPackageWithMinimumConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredWithMinimum]. */ + /** A builder for [TieredPackageWithMinimum]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -23756,45 +25892,48 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("tiered_with_minimum") + private var modelType: JsonValue = JsonValue.from("tiered_package_with_minimum") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var tieredWithMinimumConfig: JsonField? = null + private var tieredPackageWithMinimumConfig: JsonField? = + null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredWithMinimum: TieredWithMinimum) = apply { - id = tieredWithMinimum.id - billableMetric = tieredWithMinimum.billableMetric - billingCycleConfiguration = tieredWithMinimum.billingCycleConfiguration - cadence = tieredWithMinimum.cadence - conversionRate = tieredWithMinimum.conversionRate - conversionRateConfig = tieredWithMinimum.conversionRateConfig - createdAt = tieredWithMinimum.createdAt - creditAllocation = tieredWithMinimum.creditAllocation - currency = tieredWithMinimum.currency - discount = tieredWithMinimum.discount - externalPriceId = tieredWithMinimum.externalPriceId - fixedPriceQuantity = tieredWithMinimum.fixedPriceQuantity - invoicingCycleConfiguration = tieredWithMinimum.invoicingCycleConfiguration - item = tieredWithMinimum.item - maximum = tieredWithMinimum.maximum - maximumAmount = tieredWithMinimum.maximumAmount - metadata = tieredWithMinimum.metadata - minimum = tieredWithMinimum.minimum - minimumAmount = tieredWithMinimum.minimumAmount - modelType = tieredWithMinimum.modelType - name = tieredWithMinimum.name - planPhaseOrder = tieredWithMinimum.planPhaseOrder - priceType = tieredWithMinimum.priceType - replacesPriceId = tieredWithMinimum.replacesPriceId - tieredWithMinimumConfig = tieredWithMinimum.tieredWithMinimumConfig - dimensionalPriceConfiguration = tieredWithMinimum.dimensionalPriceConfiguration - additionalProperties = tieredWithMinimum.additionalProperties.toMutableMap() + internal fun from(tieredPackageWithMinimum: TieredPackageWithMinimum) = apply { + id = tieredPackageWithMinimum.id + billableMetric = tieredPackageWithMinimum.billableMetric + billingCycleConfiguration = tieredPackageWithMinimum.billingCycleConfiguration + cadence = tieredPackageWithMinimum.cadence + conversionRate = tieredPackageWithMinimum.conversionRate + conversionRateConfig = tieredPackageWithMinimum.conversionRateConfig + createdAt = tieredPackageWithMinimum.createdAt + creditAllocation = tieredPackageWithMinimum.creditAllocation + currency = tieredPackageWithMinimum.currency + discount = tieredPackageWithMinimum.discount + externalPriceId = tieredPackageWithMinimum.externalPriceId + fixedPriceQuantity = tieredPackageWithMinimum.fixedPriceQuantity + invoicingCycleConfiguration = tieredPackageWithMinimum.invoicingCycleConfiguration + item = tieredPackageWithMinimum.item + maximum = tieredPackageWithMinimum.maximum + maximumAmount = tieredPackageWithMinimum.maximumAmount + metadata = tieredPackageWithMinimum.metadata + minimum = tieredPackageWithMinimum.minimum + minimumAmount = tieredPackageWithMinimum.minimumAmount + modelType = tieredPackageWithMinimum.modelType + name = tieredPackageWithMinimum.name + planPhaseOrder = tieredPackageWithMinimum.planPhaseOrder + priceType = tieredPackageWithMinimum.priceType + replacesPriceId = tieredPackageWithMinimum.replacesPriceId + tieredPackageWithMinimumConfig = + tieredPackageWithMinimum.tieredPackageWithMinimumConfig + dimensionalPriceConfiguration = + tieredPackageWithMinimum.dimensionalPriceConfiguration + additionalProperties = tieredPackageWithMinimum.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -24256,7 +26395,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("tiered_with_minimum") + * JsonValue.from("tiered_package_with_minimum") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -24333,19 +26472,20 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun tieredWithMinimumConfig(tieredWithMinimumConfig: TieredWithMinimumConfig) = - tieredWithMinimumConfig(JsonField.of(tieredWithMinimumConfig)) + fun tieredPackageWithMinimumConfig( + tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig + ) = tieredPackageWithMinimumConfig(JsonField.of(tieredPackageWithMinimumConfig)) /** - * Sets [Builder.tieredWithMinimumConfig] to an arbitrary JSON value. + * Sets [Builder.tieredPackageWithMinimumConfig] to an arbitrary JSON value. * - * You should usually call [Builder.tieredWithMinimumConfig] with a well-typed - * [TieredWithMinimumConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. + * You should usually call [Builder.tieredPackageWithMinimumConfig] with a well-typed + * [TieredPackageWithMinimumConfig] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun tieredWithMinimumConfig( - tieredWithMinimumConfig: JsonField - ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + fun tieredPackageWithMinimumConfig( + tieredPackageWithMinimumConfig: JsonField + ) = apply { this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig } fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? @@ -24390,7 +26530,7 @@ private constructor( } /** - * Returns an immutable instance of [TieredWithMinimum]. + * Returns an immutable instance of [TieredPackageWithMinimum]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -24419,13 +26559,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredWithMinimumConfig() + * .tieredPackageWithMinimumConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): TieredWithMinimum = - TieredWithMinimum( + fun build(): TieredPackageWithMinimum = + TieredPackageWithMinimum( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -24450,7 +26590,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), + checkRequired("tieredPackageWithMinimumConfig", tieredPackageWithMinimumConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -24458,7 +26598,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TieredWithMinimum = apply { + fun validate(): TieredPackageWithMinimum = apply { if (validated) { return@apply } @@ -24483,7 +26623,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("tiered_with_minimum")) { + if (it != JsonValue.from("tiered_package_with_minimum")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -24491,7 +26631,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - tieredWithMinimumConfig().validate() + tieredPackageWithMinimumConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -24531,12 +26671,14 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("tiered_with_minimum")) 1 else 0 } + + modelType.let { + if (it == JsonValue.from("tiered_package_with_minimum")) 1 else 0 + } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (tieredWithMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + + (tieredPackageWithMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -25111,7 +27253,7 @@ private constructor( override fun toString() = value.toString() } - class TieredWithMinimumConfig + class TieredPackageWithMinimumConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -25128,21 +27270,22 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [TieredWithMinimumConfig]. + * [TieredPackageWithMinimumConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredWithMinimumConfig]. */ + /** A builder for [TieredPackageWithMinimumConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredWithMinimumConfig: TieredWithMinimumConfig) = apply { - additionalProperties = - tieredWithMinimumConfig.additionalProperties.toMutableMap() - } + internal fun from(tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig) = + apply { + additionalProperties = + tieredPackageWithMinimumConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -25167,17 +27310,17 @@ private constructor( } /** - * Returns an immutable instance of [TieredWithMinimumConfig]. + * Returns an immutable instance of [TieredPackageWithMinimumConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): TieredWithMinimumConfig = - TieredWithMinimumConfig(additionalProperties.toImmutable()) + fun build(): TieredPackageWithMinimumConfig = + TieredPackageWithMinimumConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): TieredWithMinimumConfig = apply { + fun validate(): TieredPackageWithMinimumConfig = apply { if (validated) { return@apply } @@ -25208,7 +27351,7 @@ private constructor( return true } - return /* spotless:off */ other is TieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -25218,7 +27361,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" + "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -25226,20 +27369,20 @@ private constructor( return true } - return /* spotless:off */ other is TieredWithMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredWithMinimumConfig == other.tieredWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackageWithMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredWithMinimumConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "TieredPackageWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class TieredPackageWithMinimum + class PackageWithAllocation private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -25262,10 +27405,10 @@ private constructor( private val minimumAmount: JsonField, private val modelType: JsonValue, private val name: JsonField, + private val packageWithAllocationConfig: JsonField, private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val tieredPackageWithMinimumConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -25321,6 +27464,9 @@ private constructor( minimumAmount: JsonField = JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing modelType: JsonValue = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("package_with_allocation_config") + @ExcludeMissing + packageWithAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("plan_phase_order") @ExcludeMissing planPhaseOrder: JsonField = JsonMissing.of(), @@ -25330,10 +27476,6 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("tiered_package_with_minimum_config") - @ExcludeMissing - tieredPackageWithMinimumConfig: JsonField = - JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -25360,10 +27502,10 @@ private constructor( minimumAmount, modelType, name, + packageWithAllocationConfig, planPhaseOrder, priceType, replacesPriceId, - tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -25498,7 +27640,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("tiered_package_with_minimum") + * JsonValue.from("package_with_allocation") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -25512,6 +27654,13 @@ private constructor( */ fun name(): String = name.getRequired("name") + /** + * @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 packageWithAllocationConfig(): PackageWithAllocationConfig = + packageWithAllocationConfig.getRequired("package_with_allocation_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -25533,13 +27682,6 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = - tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -25732,6 +27874,17 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [packageWithAllocationConfig]. + * + * Unlike [packageWithAllocationConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("package_with_allocation_config") + @ExcludeMissing + fun _packageWithAllocationConfig(): JsonField = + packageWithAllocationConfig + /** * Returns the raw JSON value of [planPhaseOrder]. * @@ -25761,17 +27914,6 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId - /** - * Returns the raw JSON value of [tieredPackageWithMinimumConfig]. - * - * Unlike [tieredPackageWithMinimumConfig], this method doesn't throw if the JSON field has - * an unexpected type. - */ - @JsonProperty("tiered_package_with_minimum_config") - @ExcludeMissing - fun _tieredPackageWithMinimumConfig(): JsonField = - tieredPackageWithMinimumConfig - /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -25798,7 +27940,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [TieredPackageWithMinimum]. + * Returns a mutable builder for constructing an instance of [PackageWithAllocation]. * * The following fields are required: * ```java @@ -25822,16 +27964,16 @@ private constructor( * .minimum() * .minimumAmount() * .name() + * .packageWithAllocationConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredPackageWithMinimumConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredPackageWithMinimum]. */ + /** A builder for [PackageWithAllocation]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -25853,48 +27995,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("tiered_package_with_minimum") + private var modelType: JsonValue = JsonValue.from("package_with_allocation") private var name: JsonField? = null + private var packageWithAllocationConfig: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var tieredPackageWithMinimumConfig: JsonField? = - null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredPackageWithMinimum: TieredPackageWithMinimum) = apply { - id = tieredPackageWithMinimum.id - billableMetric = tieredPackageWithMinimum.billableMetric - billingCycleConfiguration = tieredPackageWithMinimum.billingCycleConfiguration - cadence = tieredPackageWithMinimum.cadence - conversionRate = tieredPackageWithMinimum.conversionRate - conversionRateConfig = tieredPackageWithMinimum.conversionRateConfig - createdAt = tieredPackageWithMinimum.createdAt - creditAllocation = tieredPackageWithMinimum.creditAllocation - currency = tieredPackageWithMinimum.currency - discount = tieredPackageWithMinimum.discount - externalPriceId = tieredPackageWithMinimum.externalPriceId - fixedPriceQuantity = tieredPackageWithMinimum.fixedPriceQuantity - invoicingCycleConfiguration = tieredPackageWithMinimum.invoicingCycleConfiguration - item = tieredPackageWithMinimum.item - maximum = tieredPackageWithMinimum.maximum - maximumAmount = tieredPackageWithMinimum.maximumAmount - metadata = tieredPackageWithMinimum.metadata - minimum = tieredPackageWithMinimum.minimum - minimumAmount = tieredPackageWithMinimum.minimumAmount - modelType = tieredPackageWithMinimum.modelType - name = tieredPackageWithMinimum.name - planPhaseOrder = tieredPackageWithMinimum.planPhaseOrder - priceType = tieredPackageWithMinimum.priceType - replacesPriceId = tieredPackageWithMinimum.replacesPriceId - tieredPackageWithMinimumConfig = - tieredPackageWithMinimum.tieredPackageWithMinimumConfig - dimensionalPriceConfiguration = - tieredPackageWithMinimum.dimensionalPriceConfiguration - additionalProperties = tieredPackageWithMinimum.additionalProperties.toMutableMap() + internal fun from(packageWithAllocation: PackageWithAllocation) = apply { + id = packageWithAllocation.id + billableMetric = packageWithAllocation.billableMetric + billingCycleConfiguration = packageWithAllocation.billingCycleConfiguration + cadence = packageWithAllocation.cadence + conversionRate = packageWithAllocation.conversionRate + conversionRateConfig = packageWithAllocation.conversionRateConfig + createdAt = packageWithAllocation.createdAt + creditAllocation = packageWithAllocation.creditAllocation + currency = packageWithAllocation.currency + discount = packageWithAllocation.discount + externalPriceId = packageWithAllocation.externalPriceId + fixedPriceQuantity = packageWithAllocation.fixedPriceQuantity + invoicingCycleConfiguration = packageWithAllocation.invoicingCycleConfiguration + item = packageWithAllocation.item + maximum = packageWithAllocation.maximum + maximumAmount = packageWithAllocation.maximumAmount + metadata = packageWithAllocation.metadata + minimum = packageWithAllocation.minimum + minimumAmount = packageWithAllocation.minimumAmount + modelType = packageWithAllocation.modelType + name = packageWithAllocation.name + packageWithAllocationConfig = packageWithAllocation.packageWithAllocationConfig + planPhaseOrder = packageWithAllocation.planPhaseOrder + priceType = packageWithAllocation.priceType + replacesPriceId = packageWithAllocation.replacesPriceId + dimensionalPriceConfiguration = packageWithAllocation.dimensionalPriceConfiguration + additionalProperties = packageWithAllocation.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -26356,7 +28495,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("tiered_package_with_minimum") + * JsonValue.from("package_with_allocation") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -26375,6 +28514,21 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + fun packageWithAllocationConfig( + packageWithAllocationConfig: PackageWithAllocationConfig + ) = packageWithAllocationConfig(JsonField.of(packageWithAllocationConfig)) + + /** + * Sets [Builder.packageWithAllocationConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.packageWithAllocationConfig] with a well-typed + * [PackageWithAllocationConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun packageWithAllocationConfig( + packageWithAllocationConfig: JsonField + ) = apply { this.packageWithAllocationConfig = packageWithAllocationConfig } + fun planPhaseOrder(planPhaseOrder: Long?) = planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) @@ -26433,21 +28587,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun tieredPackageWithMinimumConfig( - tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig - ) = tieredPackageWithMinimumConfig(JsonField.of(tieredPackageWithMinimumConfig)) - - /** - * Sets [Builder.tieredPackageWithMinimumConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.tieredPackageWithMinimumConfig] with a well-typed - * [TieredPackageWithMinimumConfig] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun tieredPackageWithMinimumConfig( - tieredPackageWithMinimumConfig: JsonField - ) = apply { this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -26491,7 +28630,7 @@ private constructor( } /** - * Returns an immutable instance of [TieredPackageWithMinimum]. + * Returns an immutable instance of [PackageWithAllocation]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -26517,16 +28656,16 @@ private constructor( * .minimum() * .minimumAmount() * .name() + * .packageWithAllocationConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredPackageWithMinimumConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): TieredPackageWithMinimum = - TieredPackageWithMinimum( + fun build(): PackageWithAllocation = + PackageWithAllocation( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -26548,10 +28687,10 @@ private constructor( checkRequired("minimumAmount", minimumAmount), modelType, checkRequired("name", name), + checkRequired("packageWithAllocationConfig", packageWithAllocationConfig), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("tieredPackageWithMinimumConfig", tieredPackageWithMinimumConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -26559,7 +28698,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TieredPackageWithMinimum = apply { + fun validate(): PackageWithAllocation = apply { if (validated) { return@apply } @@ -26584,15 +28723,15 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("tiered_package_with_minimum")) { + if (it != JsonValue.from("package_with_allocation")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } name() + packageWithAllocationConfig().validate() planPhaseOrder() priceType().validate() replacesPriceId() - tieredPackageWithMinimumConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -26632,14 +28771,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { - if (it == JsonValue.from("tiered_package_with_minimum")) 1 else 0 - } + + modelType.let { if (it == JsonValue.from("package_with_allocation")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + + (packageWithAllocationConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (tieredPackageWithMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -27085,6 +29222,117 @@ private constructor( override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + class PackageWithAllocationConfig + @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 + * [PackageWithAllocationConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(packageWithAllocationConfig: PackageWithAllocationConfig) = + apply { + additionalProperties = + packageWithAllocationConfig.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 [PackageWithAllocationConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): PackageWithAllocationConfig = + PackageWithAllocationConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): PackageWithAllocationConfig = 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 /* spotless:off */ other is PackageWithAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PackageWithAllocationConfig{additionalProperties=$additionalProperties}" + } + class PriceType @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -27214,136 +29462,25 @@ private constructor( override fun toString() = value.toString() } - class TieredPackageWithMinimumConfig - @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 - * [TieredPackageWithMinimumConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [TieredPackageWithMinimumConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig) = - apply { - additionalProperties = - tieredPackageWithMinimumConfig.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 [TieredPackageWithMinimumConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): TieredPackageWithMinimumConfig = - TieredPackageWithMinimumConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): TieredPackageWithMinimumConfig = 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 /* spotless:off */ other is TieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" - } - override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredPackageWithMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PackageWithAllocation && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && packageWithAllocationConfig == other.packageWithAllocationConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, packageWithAllocationConfig, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackageWithMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "PackageWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class PackageWithAllocation + class UnitWithPercent private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -27366,10 +29503,10 @@ private constructor( private val minimumAmount: JsonField, private val modelType: JsonValue, private val name: JsonField, - private val packageWithAllocationConfig: JsonField, private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, + private val unitWithPercentConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -27425,9 +29562,6 @@ private constructor( minimumAmount: JsonField = JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing modelType: JsonValue = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), - @JsonProperty("package_with_allocation_config") - @ExcludeMissing - packageWithAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("plan_phase_order") @ExcludeMissing planPhaseOrder: JsonField = JsonMissing.of(), @@ -27437,6 +29571,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("unit_with_percent_config") + @ExcludeMissing + unitWithPercentConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -27463,10 +29600,10 @@ private constructor( minimumAmount, modelType, name, - packageWithAllocationConfig, planPhaseOrder, priceType, replacesPriceId, + unitWithPercentConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -27601,7 +29738,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("package_with_allocation") + * JsonValue.from("unit_with_percent") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -27615,13 +29752,6 @@ private constructor( */ fun name(): String = name.getRequired("name") - /** - * @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 packageWithAllocationConfig(): PackageWithAllocationConfig = - packageWithAllocationConfig.getRequired("package_with_allocation_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -27643,6 +29773,13 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 unitWithPercentConfig(): UnitWithPercentConfig = + unitWithPercentConfig.getRequired("unit_with_percent_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -27835,17 +29972,6 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - /** - * Returns the raw JSON value of [packageWithAllocationConfig]. - * - * Unlike [packageWithAllocationConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("package_with_allocation_config") - @ExcludeMissing - fun _packageWithAllocationConfig(): JsonField = - packageWithAllocationConfig - /** * Returns the raw JSON value of [planPhaseOrder]. * @@ -27875,6 +30001,16 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId + /** + * Returns the raw JSON value of [unitWithPercentConfig]. + * + * Unlike [unitWithPercentConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("unit_with_percent_config") + @ExcludeMissing + fun _unitWithPercentConfig(): JsonField = unitWithPercentConfig + /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -27901,7 +30037,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [PackageWithAllocation]. + * Returns a mutable builder for constructing an instance of [UnitWithPercent]. * * The following fields are required: * ```java @@ -27925,16 +30061,16 @@ private constructor( * .minimum() * .minimumAmount() * .name() - * .packageWithAllocationConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .unitWithPercentConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [PackageWithAllocation]. */ + /** A builder for [UnitWithPercent]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -27956,45 +30092,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("package_with_allocation") + private var modelType: JsonValue = JsonValue.from("unit_with_percent") private var name: JsonField? = null - private var packageWithAllocationConfig: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null + private var unitWithPercentConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(packageWithAllocation: PackageWithAllocation) = apply { - id = packageWithAllocation.id - billableMetric = packageWithAllocation.billableMetric - billingCycleConfiguration = packageWithAllocation.billingCycleConfiguration - cadence = packageWithAllocation.cadence - conversionRate = packageWithAllocation.conversionRate - conversionRateConfig = packageWithAllocation.conversionRateConfig - createdAt = packageWithAllocation.createdAt - creditAllocation = packageWithAllocation.creditAllocation - currency = packageWithAllocation.currency - discount = packageWithAllocation.discount - externalPriceId = packageWithAllocation.externalPriceId - fixedPriceQuantity = packageWithAllocation.fixedPriceQuantity - invoicingCycleConfiguration = packageWithAllocation.invoicingCycleConfiguration - item = packageWithAllocation.item - maximum = packageWithAllocation.maximum - maximumAmount = packageWithAllocation.maximumAmount - metadata = packageWithAllocation.metadata - minimum = packageWithAllocation.minimum - minimumAmount = packageWithAllocation.minimumAmount - modelType = packageWithAllocation.modelType - name = packageWithAllocation.name - packageWithAllocationConfig = packageWithAllocation.packageWithAllocationConfig - planPhaseOrder = packageWithAllocation.planPhaseOrder - priceType = packageWithAllocation.priceType - replacesPriceId = packageWithAllocation.replacesPriceId - dimensionalPriceConfiguration = packageWithAllocation.dimensionalPriceConfiguration - additionalProperties = packageWithAllocation.additionalProperties.toMutableMap() + internal fun from(unitWithPercent: UnitWithPercent) = apply { + id = unitWithPercent.id + billableMetric = unitWithPercent.billableMetric + billingCycleConfiguration = unitWithPercent.billingCycleConfiguration + cadence = unitWithPercent.cadence + conversionRate = unitWithPercent.conversionRate + conversionRateConfig = unitWithPercent.conversionRateConfig + createdAt = unitWithPercent.createdAt + creditAllocation = unitWithPercent.creditAllocation + currency = unitWithPercent.currency + discount = unitWithPercent.discount + externalPriceId = unitWithPercent.externalPriceId + fixedPriceQuantity = unitWithPercent.fixedPriceQuantity + invoicingCycleConfiguration = unitWithPercent.invoicingCycleConfiguration + item = unitWithPercent.item + maximum = unitWithPercent.maximum + maximumAmount = unitWithPercent.maximumAmount + metadata = unitWithPercent.metadata + minimum = unitWithPercent.minimum + minimumAmount = unitWithPercent.minimumAmount + modelType = unitWithPercent.modelType + name = unitWithPercent.name + planPhaseOrder = unitWithPercent.planPhaseOrder + priceType = unitWithPercent.priceType + replacesPriceId = unitWithPercent.replacesPriceId + unitWithPercentConfig = unitWithPercent.unitWithPercentConfig + dimensionalPriceConfiguration = unitWithPercent.dimensionalPriceConfiguration + additionalProperties = unitWithPercent.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -28456,7 +30592,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("package_with_allocation") + * JsonValue.from("unit_with_percent") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -28475,21 +30611,6 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - fun packageWithAllocationConfig( - packageWithAllocationConfig: PackageWithAllocationConfig - ) = packageWithAllocationConfig(JsonField.of(packageWithAllocationConfig)) - - /** - * Sets [Builder.packageWithAllocationConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.packageWithAllocationConfig] with a well-typed - * [PackageWithAllocationConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun packageWithAllocationConfig( - packageWithAllocationConfig: JsonField - ) = apply { this.packageWithAllocationConfig = packageWithAllocationConfig } - fun planPhaseOrder(planPhaseOrder: Long?) = planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) @@ -28548,6 +30669,21 @@ private constructor( this.replacesPriceId = replacesPriceId } + fun unitWithPercentConfig(unitWithPercentConfig: UnitWithPercentConfig) = + unitWithPercentConfig(JsonField.of(unitWithPercentConfig)) + + /** + * Sets [Builder.unitWithPercentConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.unitWithPercentConfig] with a well-typed + * [UnitWithPercentConfig] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun unitWithPercentConfig(unitWithPercentConfig: JsonField) = + apply { + this.unitWithPercentConfig = unitWithPercentConfig + } + fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -28591,7 +30727,7 @@ private constructor( } /** - * Returns an immutable instance of [PackageWithAllocation]. + * Returns an immutable instance of [UnitWithPercent]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -28617,16 +30753,16 @@ private constructor( * .minimum() * .minimumAmount() * .name() - * .packageWithAllocationConfig() * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .unitWithPercentConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): PackageWithAllocation = - PackageWithAllocation( + fun build(): UnitWithPercent = + UnitWithPercent( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -28648,10 +30784,10 @@ private constructor( checkRequired("minimumAmount", minimumAmount), modelType, checkRequired("name", name), - checkRequired("packageWithAllocationConfig", packageWithAllocationConfig), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), + checkRequired("unitWithPercentConfig", unitWithPercentConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -28659,7 +30795,7 @@ private constructor( private var validated: Boolean = false - fun validate(): PackageWithAllocation = apply { + fun validate(): UnitWithPercent = apply { if (validated) { return@apply } @@ -28684,15 +30820,15 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("package_with_allocation")) { + if (it != JsonValue.from("unit_with_percent")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } name() - packageWithAllocationConfig().validate() planPhaseOrder() priceType().validate() replacesPriceId() + unitWithPercentConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -28732,12 +30868,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("package_with_allocation")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("unit_with_percent")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + - (packageWithAllocationConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (unitWithPercentConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -29183,117 +31319,6 @@ private constructor( override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } - class PackageWithAllocationConfig - @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 - * [PackageWithAllocationConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [PackageWithAllocationConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(packageWithAllocationConfig: PackageWithAllocationConfig) = - apply { - additionalProperties = - packageWithAllocationConfig.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 [PackageWithAllocationConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): PackageWithAllocationConfig = - PackageWithAllocationConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): PackageWithAllocationConfig = 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 /* spotless:off */ other is PackageWithAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "PackageWithAllocationConfig{additionalProperties=$additionalProperties}" - } - class PriceType @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -29423,25 +31448,134 @@ private constructor( override fun toString() = value.toString() } + class UnitWithPercentConfig + @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 + * [UnitWithPercentConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unitWithPercentConfig: UnitWithPercentConfig) = apply { + additionalProperties = unitWithPercentConfig.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 [UnitWithPercentConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UnitWithPercentConfig = + UnitWithPercentConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): UnitWithPercentConfig = 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 /* spotless:off */ other is UnitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UnitWithPercentConfig{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is PackageWithAllocation && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && packageWithAllocationConfig == other.packageWithAllocationConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithPercent && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && unitWithPercentConfig == other.unitWithPercentConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, packageWithAllocationConfig, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, unitWithPercentConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PackageWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "UnitWithPercent{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class UnitWithPercent + class MatrixWithAllocation private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -29457,6 +31591,7 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, + private val matrixWithAllocationConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -29467,7 +31602,6 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val unitWithPercentConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -29510,6 +31644,9 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), + @JsonProperty("matrix_with_allocation_config") + @ExcludeMissing + matrixWithAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -29532,9 +31669,6 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_percent_config") - @ExcludeMissing - unitWithPercentConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -29554,6 +31688,7 @@ private constructor( fixedPriceQuantity, invoicingCycleConfiguration, item, + matrixWithAllocationConfig, maximum, maximumAmount, metadata, @@ -29564,7 +31699,6 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - unitWithPercentConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -29660,6 +31794,13 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") + /** + * @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 matrixWithAllocationConfig(): MatrixWithAllocationConfig = + matrixWithAllocationConfig.getRequired("matrix_with_allocation_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -29699,7 +31840,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("unit_with_percent") + * JsonValue.from("matrix_with_allocation") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -29734,13 +31875,6 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 unitWithPercentConfig(): UnitWithPercentConfig = - unitWithPercentConfig.getRequired("unit_with_percent_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -29877,6 +32011,17 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item + /** + * Returns the raw JSON value of [matrixWithAllocationConfig]. + * + * Unlike [matrixWithAllocationConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("matrix_with_allocation_config") + @ExcludeMissing + fun _matrixWithAllocationConfig(): JsonField = + matrixWithAllocationConfig + /** * Returns the raw JSON value of [maximum]. * @@ -29962,16 +32107,6 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId - /** - * Returns the raw JSON value of [unitWithPercentConfig]. - * - * Unlike [unitWithPercentConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("unit_with_percent_config") - @ExcludeMissing - fun _unitWithPercentConfig(): JsonField = unitWithPercentConfig - /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -29998,7 +32133,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnitWithPercent]. + * Returns a mutable builder for constructing an instance of [MatrixWithAllocation]. * * The following fields are required: * ```java @@ -30016,6 +32151,7 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() + * .matrixWithAllocationConfig() * .maximum() * .maximumAmount() * .metadata() @@ -30025,13 +32161,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .unitWithPercentConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [UnitWithPercent]. */ + /** A builder for [MatrixWithAllocation]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -30048,50 +32183,50 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null + private var matrixWithAllocationConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("unit_with_percent") + private var modelType: JsonValue = JsonValue.from("matrix_with_allocation") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var unitWithPercentConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithPercent: UnitWithPercent) = apply { - id = unitWithPercent.id - billableMetric = unitWithPercent.billableMetric - billingCycleConfiguration = unitWithPercent.billingCycleConfiguration - cadence = unitWithPercent.cadence - conversionRate = unitWithPercent.conversionRate - conversionRateConfig = unitWithPercent.conversionRateConfig - createdAt = unitWithPercent.createdAt - creditAllocation = unitWithPercent.creditAllocation - currency = unitWithPercent.currency - discount = unitWithPercent.discount - externalPriceId = unitWithPercent.externalPriceId - fixedPriceQuantity = unitWithPercent.fixedPriceQuantity - invoicingCycleConfiguration = unitWithPercent.invoicingCycleConfiguration - item = unitWithPercent.item - maximum = unitWithPercent.maximum - maximumAmount = unitWithPercent.maximumAmount - metadata = unitWithPercent.metadata - minimum = unitWithPercent.minimum - minimumAmount = unitWithPercent.minimumAmount - modelType = unitWithPercent.modelType - name = unitWithPercent.name - planPhaseOrder = unitWithPercent.planPhaseOrder - priceType = unitWithPercent.priceType - replacesPriceId = unitWithPercent.replacesPriceId - unitWithPercentConfig = unitWithPercent.unitWithPercentConfig - dimensionalPriceConfiguration = unitWithPercent.dimensionalPriceConfiguration - additionalProperties = unitWithPercent.additionalProperties.toMutableMap() + internal fun from(matrixWithAllocation: MatrixWithAllocation) = apply { + id = matrixWithAllocation.id + billableMetric = matrixWithAllocation.billableMetric + billingCycleConfiguration = matrixWithAllocation.billingCycleConfiguration + cadence = matrixWithAllocation.cadence + conversionRate = matrixWithAllocation.conversionRate + conversionRateConfig = matrixWithAllocation.conversionRateConfig + createdAt = matrixWithAllocation.createdAt + creditAllocation = matrixWithAllocation.creditAllocation + currency = matrixWithAllocation.currency + discount = matrixWithAllocation.discount + externalPriceId = matrixWithAllocation.externalPriceId + fixedPriceQuantity = matrixWithAllocation.fixedPriceQuantity + invoicingCycleConfiguration = matrixWithAllocation.invoicingCycleConfiguration + item = matrixWithAllocation.item + matrixWithAllocationConfig = matrixWithAllocation.matrixWithAllocationConfig + maximum = matrixWithAllocation.maximum + maximumAmount = matrixWithAllocation.maximumAmount + metadata = matrixWithAllocation.metadata + minimum = matrixWithAllocation.minimum + minimumAmount = matrixWithAllocation.minimumAmount + modelType = matrixWithAllocation.modelType + name = matrixWithAllocation.name + planPhaseOrder = matrixWithAllocation.planPhaseOrder + priceType = matrixWithAllocation.priceType + replacesPriceId = matrixWithAllocation.replacesPriceId + dimensionalPriceConfiguration = matrixWithAllocation.dimensionalPriceConfiguration + additionalProperties = matrixWithAllocation.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -30455,6 +32590,20 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } + fun matrixWithAllocationConfig(matrixWithAllocationConfig: MatrixWithAllocationConfig) = + matrixWithAllocationConfig(JsonField.of(matrixWithAllocationConfig)) + + /** + * Sets [Builder.matrixWithAllocationConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.matrixWithAllocationConfig] with a well-typed + * [MatrixWithAllocationConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun matrixWithAllocationConfig( + matrixWithAllocationConfig: JsonField + ) = apply { this.matrixWithAllocationConfig = matrixWithAllocationConfig } + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -30553,7 +32702,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("unit_with_percent") + * JsonValue.from("matrix_with_allocation") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -30630,21 +32779,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun unitWithPercentConfig(unitWithPercentConfig: UnitWithPercentConfig) = - unitWithPercentConfig(JsonField.of(unitWithPercentConfig)) - - /** - * Sets [Builder.unitWithPercentConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.unitWithPercentConfig] with a well-typed - * [UnitWithPercentConfig] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun unitWithPercentConfig(unitWithPercentConfig: JsonField) = - apply { - this.unitWithPercentConfig = unitWithPercentConfig - } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -30688,7 +32822,7 @@ private constructor( } /** - * Returns an immutable instance of [UnitWithPercent]. + * Returns an immutable instance of [MatrixWithAllocation]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -30708,6 +32842,7 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() + * .matrixWithAllocationConfig() * .maximum() * .maximumAmount() * .metadata() @@ -30717,13 +32852,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .unitWithPercentConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnitWithPercent = - UnitWithPercent( + fun build(): MatrixWithAllocation = + MatrixWithAllocation( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -30738,6 +32872,7 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), + checkRequired("matrixWithAllocationConfig", matrixWithAllocationConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -30748,7 +32883,6 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("unitWithPercentConfig", unitWithPercentConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -30756,7 +32890,7 @@ private constructor( private var validated: Boolean = false - fun validate(): UnitWithPercent = apply { + fun validate(): MatrixWithAllocation = apply { if (validated) { return@apply } @@ -30775,13 +32909,14 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() + matrixWithAllocationConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("unit_with_percent")) { + if (it != JsonValue.from("matrix_with_allocation")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -30789,7 +32924,6 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - unitWithPercentConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -30824,17 +32958,17 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + + (matrixWithAllocationConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("unit_with_percent")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("matrix_with_allocation")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (unitWithPercentConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -31409,134 +33543,25 @@ private constructor( override fun toString() = value.toString() } - class UnitWithPercentConfig - @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 - * [UnitWithPercentConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [UnitWithPercentConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(unitWithPercentConfig: UnitWithPercentConfig) = apply { - additionalProperties = unitWithPercentConfig.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 [UnitWithPercentConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): UnitWithPercentConfig = - UnitWithPercentConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): UnitWithPercentConfig = 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 /* spotless:off */ other is UnitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "UnitWithPercentConfig{additionalProperties=$additionalProperties}" - } - override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is UnitWithPercent && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && unitWithPercentConfig == other.unitWithPercentConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithAllocation && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixWithAllocationConfig == other.matrixWithAllocationConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, unitWithPercentConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithAllocationConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithPercent{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "MatrixWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class MatrixWithAllocation + class TieredWithProration private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -31552,7 +33577,6 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, - private val matrixWithAllocationConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -31563,6 +33587,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, + private val tieredWithProrationConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -31605,9 +33630,6 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), - @JsonProperty("matrix_with_allocation_config") - @ExcludeMissing - matrixWithAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -31630,6 +33652,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("tiered_with_proration_config") + @ExcludeMissing + tieredWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -31649,7 +33674,6 @@ private constructor( fixedPriceQuantity, invoicingCycleConfiguration, item, - matrixWithAllocationConfig, maximum, maximumAmount, metadata, @@ -31660,6 +33684,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, + tieredWithProrationConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -31755,13 +33780,6 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") - /** - * @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 matrixWithAllocationConfig(): MatrixWithAllocationConfig = - matrixWithAllocationConfig.getRequired("matrix_with_allocation_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -31801,7 +33819,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("matrix_with_allocation") + * JsonValue.from("tiered_with_proration") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -31836,6 +33854,13 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 tieredWithProrationConfig(): TieredWithProrationConfig = + tieredWithProrationConfig.getRequired("tiered_with_proration_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -31972,17 +33997,6 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - /** - * Returns the raw JSON value of [matrixWithAllocationConfig]. - * - * Unlike [matrixWithAllocationConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("matrix_with_allocation_config") - @ExcludeMissing - fun _matrixWithAllocationConfig(): JsonField = - matrixWithAllocationConfig - /** * Returns the raw JSON value of [maximum]. * @@ -32068,6 +34082,17 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId + /** + * Returns the raw JSON value of [tieredWithProrationConfig]. + * + * Unlike [tieredWithProrationConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("tiered_with_proration_config") + @ExcludeMissing + fun _tieredWithProrationConfig(): JsonField = + tieredWithProrationConfig + /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -32094,7 +34119,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MatrixWithAllocation]. + * Returns a mutable builder for constructing an instance of [TieredWithProration]. * * The following fields are required: * ```java @@ -32112,7 +34137,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .matrixWithAllocationConfig() * .maximum() * .maximumAmount() * .metadata() @@ -32122,12 +34146,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .tieredWithProrationConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [MatrixWithAllocation]. */ + /** A builder for [TieredWithProration]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -32144,50 +34169,50 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var matrixWithAllocationConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("matrix_with_allocation") + private var modelType: JsonValue = JsonValue.from("tiered_with_proration") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null + private var tieredWithProrationConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(matrixWithAllocation: MatrixWithAllocation) = apply { - id = matrixWithAllocation.id - billableMetric = matrixWithAllocation.billableMetric - billingCycleConfiguration = matrixWithAllocation.billingCycleConfiguration - cadence = matrixWithAllocation.cadence - conversionRate = matrixWithAllocation.conversionRate - conversionRateConfig = matrixWithAllocation.conversionRateConfig - createdAt = matrixWithAllocation.createdAt - creditAllocation = matrixWithAllocation.creditAllocation - currency = matrixWithAllocation.currency - discount = matrixWithAllocation.discount - externalPriceId = matrixWithAllocation.externalPriceId - fixedPriceQuantity = matrixWithAllocation.fixedPriceQuantity - invoicingCycleConfiguration = matrixWithAllocation.invoicingCycleConfiguration - item = matrixWithAllocation.item - matrixWithAllocationConfig = matrixWithAllocation.matrixWithAllocationConfig - maximum = matrixWithAllocation.maximum - maximumAmount = matrixWithAllocation.maximumAmount - metadata = matrixWithAllocation.metadata - minimum = matrixWithAllocation.minimum - minimumAmount = matrixWithAllocation.minimumAmount - modelType = matrixWithAllocation.modelType - name = matrixWithAllocation.name - planPhaseOrder = matrixWithAllocation.planPhaseOrder - priceType = matrixWithAllocation.priceType - replacesPriceId = matrixWithAllocation.replacesPriceId - dimensionalPriceConfiguration = matrixWithAllocation.dimensionalPriceConfiguration - additionalProperties = matrixWithAllocation.additionalProperties.toMutableMap() + internal fun from(tieredWithProration: TieredWithProration) = apply { + id = tieredWithProration.id + billableMetric = tieredWithProration.billableMetric + billingCycleConfiguration = tieredWithProration.billingCycleConfiguration + cadence = tieredWithProration.cadence + conversionRate = tieredWithProration.conversionRate + conversionRateConfig = tieredWithProration.conversionRateConfig + createdAt = tieredWithProration.createdAt + creditAllocation = tieredWithProration.creditAllocation + currency = tieredWithProration.currency + discount = tieredWithProration.discount + externalPriceId = tieredWithProration.externalPriceId + fixedPriceQuantity = tieredWithProration.fixedPriceQuantity + invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration + item = tieredWithProration.item + maximum = tieredWithProration.maximum + maximumAmount = tieredWithProration.maximumAmount + metadata = tieredWithProration.metadata + minimum = tieredWithProration.minimum + minimumAmount = tieredWithProration.minimumAmount + modelType = tieredWithProration.modelType + name = tieredWithProration.name + planPhaseOrder = tieredWithProration.planPhaseOrder + priceType = tieredWithProration.priceType + replacesPriceId = tieredWithProration.replacesPriceId + tieredWithProrationConfig = tieredWithProration.tieredWithProrationConfig + dimensionalPriceConfiguration = tieredWithProration.dimensionalPriceConfiguration + additionalProperties = tieredWithProration.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -32551,20 +34576,6 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } - fun matrixWithAllocationConfig(matrixWithAllocationConfig: MatrixWithAllocationConfig) = - matrixWithAllocationConfig(JsonField.of(matrixWithAllocationConfig)) - - /** - * Sets [Builder.matrixWithAllocationConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.matrixWithAllocationConfig] with a well-typed - * [MatrixWithAllocationConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun matrixWithAllocationConfig( - matrixWithAllocationConfig: JsonField - ) = apply { this.matrixWithAllocationConfig = matrixWithAllocationConfig } - @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -32663,7 +34674,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("matrix_with_allocation") + * JsonValue.from("tiered_with_proration") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -32740,6 +34751,20 @@ private constructor( this.replacesPriceId = replacesPriceId } + fun tieredWithProrationConfig(tieredWithProrationConfig: TieredWithProrationConfig) = + tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) + + /** + * Sets [Builder.tieredWithProrationConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.tieredWithProrationConfig] with a well-typed + * [TieredWithProrationConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun tieredWithProrationConfig( + tieredWithProrationConfig: JsonField + ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } + fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -32783,7 +34808,7 @@ private constructor( } /** - * Returns an immutable instance of [MatrixWithAllocation]. + * Returns an immutable instance of [TieredWithProration]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -32803,7 +34828,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .matrixWithAllocationConfig() * .maximum() * .maximumAmount() * .metadata() @@ -32813,12 +34837,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .tieredWithProrationConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): MatrixWithAllocation = - MatrixWithAllocation( + fun build(): TieredWithProration = + TieredWithProration( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -32833,7 +34858,6 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("matrixWithAllocationConfig", matrixWithAllocationConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -32844,6 +34868,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), + checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -32851,7 +34876,7 @@ private constructor( private var validated: Boolean = false - fun validate(): MatrixWithAllocation = apply { + fun validate(): TieredWithProration = apply { if (validated) { return@apply } @@ -32870,14 +34895,13 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - matrixWithAllocationConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("matrix_with_allocation")) { + if (it != JsonValue.from("tiered_with_proration")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -32885,6 +34909,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() + tieredWithProrationConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -32919,17 +34944,17 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + - (matrixWithAllocationConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("matrix_with_allocation")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("tiered_with_proration")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (tieredWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -33504,25 +35529,135 @@ private constructor( override fun toString() = value.toString() } + class TieredWithProrationConfig + @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 + * [TieredWithProrationConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = apply { + additionalProperties = + tieredWithProrationConfig.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [TieredWithProrationConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TieredWithProrationConfig = + TieredWithProrationConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): TieredWithProrationConfig = 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 /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TieredWithProrationConfig{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is MatrixWithAllocation && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixWithAllocationConfig == other.matrixWithAllocationConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithProration && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredWithProrationConfig == other.tieredWithProrationConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithAllocationConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredWithProrationConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "TieredWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class TieredWithProration + class UnitWithProration private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -33548,7 +35683,7 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val tieredWithProrationConfig: JsonField, + private val unitWithProrationConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -33613,9 +35748,9 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("tiered_with_proration_config") + @JsonProperty("unit_with_proration_config") @ExcludeMissing - tieredWithProrationConfig: JsonField = JsonMissing.of(), + unitWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -33645,7 +35780,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - tieredWithProrationConfig, + unitWithProrationConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -33780,7 +35915,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("tiered_with_proration") + * JsonValue.from("unit_with_proration") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -33819,8 +35954,8 @@ private constructor( * @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 tieredWithProrationConfig(): TieredWithProrationConfig = - tieredWithProrationConfig.getRequired("tiered_with_proration_config") + fun unitWithProrationConfig(): UnitWithProrationConfig = + unitWithProrationConfig.getRequired("unit_with_proration_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -34044,15 +36179,14 @@ private constructor( fun _replacesPriceId(): JsonField = replacesPriceId /** - * Returns the raw JSON value of [tieredWithProrationConfig]. + * Returns the raw JSON value of [unitWithProrationConfig]. * - * Unlike [tieredWithProrationConfig], this method doesn't throw if the JSON field has an + * Unlike [unitWithProrationConfig], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("tiered_with_proration_config") + @JsonProperty("unit_with_proration_config") @ExcludeMissing - fun _tieredWithProrationConfig(): JsonField = - tieredWithProrationConfig + fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. @@ -34080,7 +36214,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [TieredWithProration]. + * Returns a mutable builder for constructing an instance of [UnitWithProration]. * * The following fields are required: * ```java @@ -34107,13 +36241,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredWithProrationConfig() + * .unitWithProrationConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredWithProration]. */ + /** A builder for [UnitWithProration]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -34135,45 +36269,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("tiered_with_proration") + private var modelType: JsonValue = JsonValue.from("unit_with_proration") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var tieredWithProrationConfig: JsonField? = null + private var unitWithProrationConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredWithProration: TieredWithProration) = apply { - id = tieredWithProration.id - billableMetric = tieredWithProration.billableMetric - billingCycleConfiguration = tieredWithProration.billingCycleConfiguration - cadence = tieredWithProration.cadence - conversionRate = tieredWithProration.conversionRate - conversionRateConfig = tieredWithProration.conversionRateConfig - createdAt = tieredWithProration.createdAt - creditAllocation = tieredWithProration.creditAllocation - currency = tieredWithProration.currency - discount = tieredWithProration.discount - externalPriceId = tieredWithProration.externalPriceId - fixedPriceQuantity = tieredWithProration.fixedPriceQuantity - invoicingCycleConfiguration = tieredWithProration.invoicingCycleConfiguration - item = tieredWithProration.item - maximum = tieredWithProration.maximum - maximumAmount = tieredWithProration.maximumAmount - metadata = tieredWithProration.metadata - minimum = tieredWithProration.minimum - minimumAmount = tieredWithProration.minimumAmount - modelType = tieredWithProration.modelType - name = tieredWithProration.name - planPhaseOrder = tieredWithProration.planPhaseOrder - priceType = tieredWithProration.priceType - replacesPriceId = tieredWithProration.replacesPriceId - tieredWithProrationConfig = tieredWithProration.tieredWithProrationConfig - dimensionalPriceConfiguration = tieredWithProration.dimensionalPriceConfiguration - additionalProperties = tieredWithProration.additionalProperties.toMutableMap() + internal fun from(unitWithProration: UnitWithProration) = apply { + id = unitWithProration.id + billableMetric = unitWithProration.billableMetric + billingCycleConfiguration = unitWithProration.billingCycleConfiguration + cadence = unitWithProration.cadence + conversionRate = unitWithProration.conversionRate + conversionRateConfig = unitWithProration.conversionRateConfig + createdAt = unitWithProration.createdAt + creditAllocation = unitWithProration.creditAllocation + currency = unitWithProration.currency + discount = unitWithProration.discount + externalPriceId = unitWithProration.externalPriceId + fixedPriceQuantity = unitWithProration.fixedPriceQuantity + invoicingCycleConfiguration = unitWithProration.invoicingCycleConfiguration + item = unitWithProration.item + maximum = unitWithProration.maximum + maximumAmount = unitWithProration.maximumAmount + metadata = unitWithProration.metadata + minimum = unitWithProration.minimum + minimumAmount = unitWithProration.minimumAmount + modelType = unitWithProration.modelType + name = unitWithProration.name + planPhaseOrder = unitWithProration.planPhaseOrder + priceType = unitWithProration.priceType + replacesPriceId = unitWithProration.replacesPriceId + unitWithProrationConfig = unitWithProration.unitWithProrationConfig + dimensionalPriceConfiguration = unitWithProration.dimensionalPriceConfiguration + additionalProperties = unitWithProration.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -34635,7 +36769,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("tiered_with_proration") + * JsonValue.from("unit_with_proration") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -34712,19 +36846,19 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun tieredWithProrationConfig(tieredWithProrationConfig: TieredWithProrationConfig) = - tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) + fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = + unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) /** - * Sets [Builder.tieredWithProrationConfig] to an arbitrary JSON value. + * Sets [Builder.unitWithProrationConfig] to an arbitrary JSON value. * - * You should usually call [Builder.tieredWithProrationConfig] with a well-typed - * [TieredWithProrationConfig] value instead. This method is primarily for setting the + * You should usually call [Builder.unitWithProrationConfig] with a well-typed + * [UnitWithProrationConfig] value instead. This method is primarily for setting the * field to an undocumented or not yet supported value. */ - fun tieredWithProrationConfig( - tieredWithProrationConfig: JsonField - ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } + fun unitWithProrationConfig( + unitWithProrationConfig: JsonField + ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? @@ -34769,7 +36903,7 @@ private constructor( } /** - * Returns an immutable instance of [TieredWithProration]. + * Returns an immutable instance of [UnitWithProration]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -34798,13 +36932,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .tieredWithProrationConfig() + * .unitWithProrationConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): TieredWithProration = - TieredWithProration( + fun build(): UnitWithProration = + UnitWithProration( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -34829,7 +36963,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), + checkRequired("unitWithProrationConfig", unitWithProrationConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -34837,7 +36971,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TieredWithProration = apply { + fun validate(): UnitWithProration = apply { if (validated) { return@apply } @@ -34862,7 +36996,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("tiered_with_proration")) { + if (it != JsonValue.from("unit_with_proration")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -34870,7 +37004,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - tieredWithProrationConfig().validate() + unitWithProrationConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -34910,12 +37044,12 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("tiered_with_proration")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("unit_with_proration")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (tieredWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + + (unitWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -35490,7 +37624,7 @@ private constructor( override fun toString() = value.toString() } - class TieredWithProrationConfig + class UnitWithProrationConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -35507,20 +37641,20 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [TieredWithProrationConfig]. + * [UnitWithProrationConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [TieredWithProrationConfig]. */ + /** A builder for [UnitWithProrationConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = apply { + internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = apply { additionalProperties = - tieredWithProrationConfig.additionalProperties.toMutableMap() + unitWithProrationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -35546,17 +37680,17 @@ private constructor( } /** - * Returns an immutable instance of [TieredWithProrationConfig]. + * Returns an immutable instance of [UnitWithProrationConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): TieredWithProrationConfig = - TieredWithProrationConfig(additionalProperties.toImmutable()) + fun build(): UnitWithProrationConfig = + UnitWithProrationConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): TieredWithProrationConfig = apply { + fun validate(): UnitWithProrationConfig = apply { if (validated) { return@apply } @@ -35587,7 +37721,7 @@ private constructor( return true } - return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -35597,7 +37731,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProrationConfig{additionalProperties=$additionalProperties}" + "UnitWithProrationConfig{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -35605,20 +37739,20 @@ private constructor( return true } - return /* spotless:off */ other is TieredWithProration && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && tieredWithProrationConfig == other.tieredWithProrationConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithProration && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && unitWithProrationConfig == other.unitWithProrationConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, tieredWithProrationConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, unitWithProrationConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "UnitWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class UnitWithProration + class GroupedAllocation private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -35632,6 +37766,7 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, + private val groupedAllocationConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -35644,7 +37779,6 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val unitWithProrationConfig: JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -35683,6 +37817,9 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("grouped_allocation_config") + @ExcludeMissing + groupedAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @@ -35709,9 +37846,6 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_proration_config") - @ExcludeMissing - unitWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -35729,6 +37863,7 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, + groupedAllocationConfig, invoicingCycleConfiguration, item, maximum, @@ -35741,7 +37876,6 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - unitWithProrationConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -35824,6 +37958,13 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") + /** + * @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 groupedAllocationConfig(): GroupedAllocationConfig = + groupedAllocationConfig.getRequired("grouped_allocation_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -35876,7 +38017,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("unit_with_proration") + * JsonValue.from("grouped_allocation") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -35911,13 +38052,6 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 unitWithProrationConfig(): UnitWithProrationConfig = - unitWithProrationConfig.getRequired("unit_with_proration_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -36036,6 +38170,16 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + /** + * Returns the raw JSON value of [groupedAllocationConfig]. + * + * Unlike [groupedAllocationConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("grouped_allocation_config") + @ExcludeMissing + fun _groupedAllocationConfig(): JsonField = groupedAllocationConfig + /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -36139,16 +38283,6 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId - /** - * Returns the raw JSON value of [unitWithProrationConfig]. - * - * Unlike [unitWithProrationConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("unit_with_proration_config") - @ExcludeMissing - fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig - /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -36175,7 +38309,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnitWithProration]. + * Returns a mutable builder for constructing an instance of [GroupedAllocation]. * * The following fields are required: * ```java @@ -36191,6 +38325,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedAllocationConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -36202,13 +38337,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .unitWithProrationConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [UnitWithProration]. */ + /** A builder for [GroupedAllocation]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -36223,6 +38357,7 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null + private var groupedAllocationConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -36230,45 +38365,44 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("unit_with_proration") + private var modelType: JsonValue = JsonValue.from("grouped_allocation") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var unitWithProrationConfig: JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithProration: UnitWithProration) = apply { - id = unitWithProration.id - billableMetric = unitWithProration.billableMetric - billingCycleConfiguration = unitWithProration.billingCycleConfiguration - cadence = unitWithProration.cadence - conversionRate = unitWithProration.conversionRate - conversionRateConfig = unitWithProration.conversionRateConfig - createdAt = unitWithProration.createdAt - creditAllocation = unitWithProration.creditAllocation - currency = unitWithProration.currency - discount = unitWithProration.discount - externalPriceId = unitWithProration.externalPriceId - fixedPriceQuantity = unitWithProration.fixedPriceQuantity - invoicingCycleConfiguration = unitWithProration.invoicingCycleConfiguration - item = unitWithProration.item - maximum = unitWithProration.maximum - maximumAmount = unitWithProration.maximumAmount - metadata = unitWithProration.metadata - minimum = unitWithProration.minimum - minimumAmount = unitWithProration.minimumAmount - modelType = unitWithProration.modelType - name = unitWithProration.name - planPhaseOrder = unitWithProration.planPhaseOrder - priceType = unitWithProration.priceType - replacesPriceId = unitWithProration.replacesPriceId - unitWithProrationConfig = unitWithProration.unitWithProrationConfig - dimensionalPriceConfiguration = unitWithProration.dimensionalPriceConfiguration - additionalProperties = unitWithProration.additionalProperties.toMutableMap() + internal fun from(groupedAllocation: GroupedAllocation) = apply { + id = groupedAllocation.id + billableMetric = groupedAllocation.billableMetric + billingCycleConfiguration = groupedAllocation.billingCycleConfiguration + cadence = groupedAllocation.cadence + conversionRate = groupedAllocation.conversionRate + conversionRateConfig = groupedAllocation.conversionRateConfig + createdAt = groupedAllocation.createdAt + creditAllocation = groupedAllocation.creditAllocation + currency = groupedAllocation.currency + discount = groupedAllocation.discount + externalPriceId = groupedAllocation.externalPriceId + fixedPriceQuantity = groupedAllocation.fixedPriceQuantity + groupedAllocationConfig = groupedAllocation.groupedAllocationConfig + invoicingCycleConfiguration = groupedAllocation.invoicingCycleConfiguration + item = groupedAllocation.item + maximum = groupedAllocation.maximum + maximumAmount = groupedAllocation.maximumAmount + metadata = groupedAllocation.metadata + minimum = groupedAllocation.minimum + minimumAmount = groupedAllocation.minimumAmount + modelType = groupedAllocation.modelType + name = groupedAllocation.name + planPhaseOrder = groupedAllocation.planPhaseOrder + priceType = groupedAllocation.priceType + replacesPriceId = groupedAllocation.replacesPriceId + dimensionalPriceConfiguration = groupedAllocation.dimensionalPriceConfiguration + additionalProperties = groupedAllocation.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -36598,6 +38732,20 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } + fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = + groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) + + /** + * Sets [Builder.groupedAllocationConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.groupedAllocationConfig] with a well-typed + * [GroupedAllocationConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun groupedAllocationConfig( + groupedAllocationConfig: JsonField + ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } + fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -36730,7 +38878,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("unit_with_proration") + * JsonValue.from("grouped_allocation") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -36807,20 +38955,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = - unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) - - /** - * Sets [Builder.unitWithProrationConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.unitWithProrationConfig] with a well-typed - * [UnitWithProrationConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun unitWithProrationConfig( - unitWithProrationConfig: JsonField - ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -36864,7 +38998,7 @@ private constructor( } /** - * Returns an immutable instance of [UnitWithProration]. + * Returns an immutable instance of [GroupedAllocation]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -36882,6 +39016,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedAllocationConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -36893,13 +39028,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .unitWithProrationConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnitWithProration = - UnitWithProration( + fun build(): GroupedAllocation = + GroupedAllocation( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -36912,6 +39046,7 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired("groupedAllocationConfig", groupedAllocationConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -36924,7 +39059,6 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired("unitWithProrationConfig", unitWithProrationConfig), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -36932,7 +39066,7 @@ private constructor( private var validated: Boolean = false - fun validate(): UnitWithProration = apply { + fun validate(): GroupedAllocation = apply { if (validated) { return@apply } @@ -36949,6 +39083,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() + groupedAllocationConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -36957,7 +39092,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("unit_with_proration")) { + if (it != JsonValue.from("grouped_allocation")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -36965,7 +39100,6 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - unitWithProrationConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -36998,6 +39132,7 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + + (groupedAllocationConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -37005,12 +39140,11 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("unit_with_proration")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("grouped_allocation")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (unitWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -37347,12 +39481,7 @@ private constructor( } } - /** - * 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 + class GroupedAllocationConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -37367,18 +39496,22 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [Metadata]. */ + /** + * Returns a mutable builder for constructing an instance of + * [GroupedAllocationConfig]. + */ @JvmStatic fun builder() = Builder() } - /** A builder for [Metadata]. */ + /** A builder for [GroupedAllocationConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(metadata: Metadata) = apply { - additionalProperties = metadata.additionalProperties.toMutableMap() + internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = apply { + additionalProperties = + groupedAllocationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -37404,16 +39537,17 @@ private constructor( } /** - * Returns an immutable instance of [Metadata]. + * Returns an immutable instance of [GroupedAllocationConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + fun build(): GroupedAllocationConfig = + GroupedAllocationConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): Metadata = apply { + fun validate(): GroupedAllocationConfig = apply { if (validated) { return@apply } @@ -37444,7 +39578,7 @@ private constructor( return true } - return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -37453,139 +39587,16 @@ private constructor( 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") - - @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) - } - - /** An enum containing [PriceType]'s known values. */ - enum class Known { - USAGE_PRICE, - FIXED_PRICE, - } - - /** - * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [PriceType] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - USAGE_PRICE, - FIXED_PRICE, - /** - * An enum member indicating that [PriceType] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - USAGE_PRICE -> Value.USAGE_PRICE - FIXED_PRICE -> Value.FIXED_PRICE - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws OrbInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - USAGE_PRICE -> Known.USAGE_PRICE - FIXED_PRICE -> Known.FIXED_PRICE - else -> throw OrbInvalidDataException("Unknown PriceType: $value") - } - - /** - * 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 /* spotless:off */ other is PriceType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + override fun toString() = + "GroupedAllocationConfig{additionalProperties=$additionalProperties}" } - class UnitWithProrationConfig + /** + * 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 @@ -37600,22 +39611,18 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of - * [UnitWithProrationConfig]. - */ + /** Returns a mutable builder for constructing an instance of [Metadata]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [UnitWithProrationConfig]. */ + /** A builder for [Metadata]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = apply { - additionalProperties = - unitWithProrationConfig.additionalProperties.toMutableMap() + internal fun from(metadata: Metadata) = apply { + additionalProperties = metadata.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -37641,17 +39648,16 @@ private constructor( } /** - * Returns an immutable instance of [UnitWithProrationConfig]. + * Returns an immutable instance of [Metadata]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): UnitWithProrationConfig = - UnitWithProrationConfig(additionalProperties.toImmutable()) + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): UnitWithProrationConfig = apply { + fun validate(): Metadata = apply { if (validated) { return@apply } @@ -37682,7 +39688,7 @@ private constructor( return true } - return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -37691,8 +39697,136 @@ private constructor( override fun hashCode(): Int = hashCode - override fun toString() = - "UnitWithProrationConfig{additionalProperties=$additionalProperties}" + 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") + + @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + } + + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_PRICE, + FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_PRICE -> Value.USAGE_PRICE + FIXED_PRICE -> Value.FIXED_PRICE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + USAGE_PRICE -> Known.USAGE_PRICE + FIXED_PRICE -> Known.FIXED_PRICE + else -> throw OrbInvalidDataException("Unknown PriceType: $value") + } + + /** + * 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 /* spotless:off */ other is PriceType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -37700,20 +39834,20 @@ private constructor( return true } - return /* spotless:off */ other is UnitWithProration && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && unitWithProrationConfig == other.unitWithProrationConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedAllocation && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedAllocationConfig == other.groupedAllocationConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, unitWithProrationConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedAllocationConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "GroupedAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class GroupedAllocation + class GroupedWithProratedMinimum private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -37727,7 +39861,7 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, - private val groupedAllocationConfig: JsonField, + private val groupedWithProratedMinimumConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -37778,9 +39912,10 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_allocation_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - groupedAllocationConfig: JsonField = JsonMissing.of(), + groupedWithProratedMinimumConfig: JsonField = + JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @@ -37824,7 +39959,7 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, - groupedAllocationConfig, + groupedWithProratedMinimumConfig, invoicingCycleConfiguration, item, maximum, @@ -37923,8 +40058,8 @@ private constructor( * @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 groupedAllocationConfig(): GroupedAllocationConfig = - groupedAllocationConfig.getRequired("grouped_allocation_config") + fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = + groupedWithProratedMinimumConfig.getRequired("grouped_with_prorated_minimum_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -37978,7 +40113,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("grouped_allocation") + * JsonValue.from("grouped_with_prorated_minimum") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -38132,14 +40267,15 @@ private constructor( fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity /** - * Returns the raw JSON value of [groupedAllocationConfig]. + * Returns the raw JSON value of [groupedWithProratedMinimumConfig]. * - * Unlike [groupedAllocationConfig], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [groupedWithProratedMinimumConfig], this method doesn't throw if the JSON field + * has an unexpected type. */ - @JsonProperty("grouped_allocation_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - fun _groupedAllocationConfig(): JsonField = groupedAllocationConfig + fun _groupedWithProratedMinimumConfig(): JsonField = + groupedWithProratedMinimumConfig /** * Returns the raw JSON value of [invoicingCycleConfiguration]. @@ -38270,7 +40406,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [GroupedAllocation]. + * Returns a mutable builder for constructing an instance of + * [GroupedWithProratedMinimum]. * * The following fields are required: * ```java @@ -38286,7 +40423,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedAllocationConfig() + * .groupedWithProratedMinimumConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -38303,7 +40440,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedAllocation]. */ + /** A builder for [GroupedWithProratedMinimum]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -38318,7 +40455,9 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedAllocationConfig: JsonField? = null + private var groupedWithProratedMinimumConfig: + JsonField? = + null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -38326,7 +40465,7 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("grouped_allocation") + private var modelType: JsonValue = JsonValue.from("grouped_with_prorated_minimum") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -38336,34 +40475,37 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedAllocation: GroupedAllocation) = apply { - id = groupedAllocation.id - billableMetric = groupedAllocation.billableMetric - billingCycleConfiguration = groupedAllocation.billingCycleConfiguration - cadence = groupedAllocation.cadence - conversionRate = groupedAllocation.conversionRate - conversionRateConfig = groupedAllocation.conversionRateConfig - createdAt = groupedAllocation.createdAt - creditAllocation = groupedAllocation.creditAllocation - currency = groupedAllocation.currency - discount = groupedAllocation.discount - externalPriceId = groupedAllocation.externalPriceId - fixedPriceQuantity = groupedAllocation.fixedPriceQuantity - groupedAllocationConfig = groupedAllocation.groupedAllocationConfig - invoicingCycleConfiguration = groupedAllocation.invoicingCycleConfiguration - item = groupedAllocation.item - maximum = groupedAllocation.maximum - maximumAmount = groupedAllocation.maximumAmount - metadata = groupedAllocation.metadata - minimum = groupedAllocation.minimum - minimumAmount = groupedAllocation.minimumAmount - modelType = groupedAllocation.modelType - name = groupedAllocation.name - planPhaseOrder = groupedAllocation.planPhaseOrder - priceType = groupedAllocation.priceType - replacesPriceId = groupedAllocation.replacesPriceId - dimensionalPriceConfiguration = groupedAllocation.dimensionalPriceConfiguration - additionalProperties = groupedAllocation.additionalProperties.toMutableMap() + internal fun from(groupedWithProratedMinimum: GroupedWithProratedMinimum) = apply { + id = groupedWithProratedMinimum.id + billableMetric = groupedWithProratedMinimum.billableMetric + billingCycleConfiguration = groupedWithProratedMinimum.billingCycleConfiguration + cadence = groupedWithProratedMinimum.cadence + conversionRate = groupedWithProratedMinimum.conversionRate + conversionRateConfig = groupedWithProratedMinimum.conversionRateConfig + createdAt = groupedWithProratedMinimum.createdAt + creditAllocation = groupedWithProratedMinimum.creditAllocation + currency = groupedWithProratedMinimum.currency + discount = groupedWithProratedMinimum.discount + externalPriceId = groupedWithProratedMinimum.externalPriceId + fixedPriceQuantity = groupedWithProratedMinimum.fixedPriceQuantity + groupedWithProratedMinimumConfig = + groupedWithProratedMinimum.groupedWithProratedMinimumConfig + invoicingCycleConfiguration = groupedWithProratedMinimum.invoicingCycleConfiguration + item = groupedWithProratedMinimum.item + maximum = groupedWithProratedMinimum.maximum + maximumAmount = groupedWithProratedMinimum.maximumAmount + metadata = groupedWithProratedMinimum.metadata + minimum = groupedWithProratedMinimum.minimum + minimumAmount = groupedWithProratedMinimum.minimumAmount + modelType = groupedWithProratedMinimum.modelType + name = groupedWithProratedMinimum.name + planPhaseOrder = groupedWithProratedMinimum.planPhaseOrder + priceType = groupedWithProratedMinimum.priceType + replacesPriceId = groupedWithProratedMinimum.replacesPriceId + dimensionalPriceConfiguration = + groupedWithProratedMinimum.dimensionalPriceConfiguration + additionalProperties = + groupedWithProratedMinimum.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -38693,19 +40835,20 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = - groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = groupedWithProratedMinimumConfig(JsonField.of(groupedWithProratedMinimumConfig)) /** - * Sets [Builder.groupedAllocationConfig] to an arbitrary JSON value. + * Sets [Builder.groupedWithProratedMinimumConfig] to an arbitrary JSON value. * - * You should usually call [Builder.groupedAllocationConfig] with a well-typed - * [GroupedAllocationConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. + * You should usually call [Builder.groupedWithProratedMinimumConfig] with a well-typed + * [GroupedWithProratedMinimumConfig] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. */ - fun groupedAllocationConfig( - groupedAllocationConfig: JsonField - ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: JsonField + ) = apply { this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig } fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? @@ -38839,7 +40982,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("grouped_allocation") + * JsonValue.from("grouped_with_prorated_minimum") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -38959,7 +41102,7 @@ private constructor( } /** - * Returns an immutable instance of [GroupedAllocation]. + * Returns an immutable instance of [GroupedWithProratedMinimum]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -38977,7 +41120,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedAllocationConfig() + * .groupedWithProratedMinimumConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -38993,8 +41136,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): GroupedAllocation = - GroupedAllocation( + fun build(): GroupedWithProratedMinimum = + GroupedWithProratedMinimum( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -39007,7 +41150,10 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("groupedAllocationConfig", groupedAllocationConfig), + checkRequired( + "groupedWithProratedMinimumConfig", + groupedWithProratedMinimumConfig, + ), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -39027,7 +41173,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedAllocation = apply { + fun validate(): GroupedWithProratedMinimum = apply { if (validated) { return@apply } @@ -39044,7 +41190,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedAllocationConfig().validate() + groupedWithProratedMinimumConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -39053,7 +41199,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("grouped_allocation")) { + if (it != JsonValue.from("grouped_with_prorated_minimum")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -39093,7 +41239,7 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + - (groupedAllocationConfig.asKnown().getOrNull()?.validity() ?: 0) + + (groupedWithProratedMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -39101,7 +41247,9 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("grouped_allocation")) 1 else 0 } + + modelType.let { + if (it == JsonValue.from("grouped_with_prorated_minimum")) 1 else 0 + } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + @@ -39442,7 +41590,7 @@ private constructor( } } - class GroupedAllocationConfig + class GroupedWithProratedMinimumConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -39459,20 +41607,22 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [GroupedAllocationConfig]. + * [GroupedWithProratedMinimumConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedAllocationConfig]. */ + /** A builder for [GroupedWithProratedMinimumConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = apply { + internal fun from( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = apply { additionalProperties = - groupedAllocationConfig.additionalProperties.toMutableMap() + groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -39498,17 +41648,17 @@ private constructor( } /** - * Returns an immutable instance of [GroupedAllocationConfig]. + * Returns an immutable instance of [GroupedWithProratedMinimumConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): GroupedAllocationConfig = - GroupedAllocationConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithProratedMinimumConfig = + GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): GroupedAllocationConfig = apply { + fun validate(): GroupedWithProratedMinimumConfig = apply { if (validated) { return@apply } @@ -39539,7 +41689,7 @@ private constructor( return true } - return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -39549,7 +41699,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedAllocationConfig{additionalProperties=$additionalProperties}" + "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" } /** @@ -39795,20 +41945,20 @@ private constructor( return true } - return /* spotless:off */ other is GroupedAllocation && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedAllocationConfig == other.groupedAllocationConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithProratedMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedAllocationConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithProratedMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedAllocation{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "GroupedWithProratedMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class GroupedWithProratedMinimum + class GroupedWithMeteredMinimum private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -39822,7 +41972,7 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, - private val groupedWithProratedMinimumConfig: JsonField, + private val groupedWithMeteredMinimumConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -39873,9 +42023,9 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_with_metered_minimum_config") @ExcludeMissing - groupedWithProratedMinimumConfig: JsonField = + groupedWithMeteredMinimumConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing @@ -39920,7 +42070,7 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, - groupedWithProratedMinimumConfig, + groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, maximum, @@ -40019,8 +42169,8 @@ private constructor( * @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 groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = - groupedWithProratedMinimumConfig.getRequired("grouped_with_prorated_minimum_config") + fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = + groupedWithMeteredMinimumConfig.getRequired("grouped_with_metered_minimum_config") /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -40074,7 +42224,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("grouped_with_prorated_minimum") + * JsonValue.from("grouped_with_metered_minimum") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -40228,15 +42378,15 @@ private constructor( fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity /** - * Returns the raw JSON value of [groupedWithProratedMinimumConfig]. + * Returns the raw JSON value of [groupedWithMeteredMinimumConfig]. * - * Unlike [groupedWithProratedMinimumConfig], this method doesn't throw if the JSON field - * has an unexpected type. + * Unlike [groupedWithMeteredMinimumConfig], this method doesn't throw if the JSON field has + * an unexpected type. */ - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_with_metered_minimum_config") @ExcludeMissing - fun _groupedWithProratedMinimumConfig(): JsonField = - groupedWithProratedMinimumConfig + fun _groupedWithMeteredMinimumConfig(): JsonField = + groupedWithMeteredMinimumConfig /** * Returns the raw JSON value of [invoicingCycleConfiguration]. @@ -40368,7 +42518,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [GroupedWithProratedMinimum]. + * [GroupedWithMeteredMinimum]. * * The following fields are required: * ```java @@ -40384,7 +42534,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedWithProratedMinimumConfig() + * .groupedWithMeteredMinimumConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -40401,7 +42551,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedWithProratedMinimum]. */ + /** A builder for [GroupedWithMeteredMinimum]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -40416,8 +42566,8 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedWithProratedMinimumConfig: - JsonField? = + private var groupedWithMeteredMinimumConfig: + JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null @@ -40426,7 +42576,7 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("grouped_with_prorated_minimum") + private var modelType: JsonValue = JsonValue.from("grouped_with_metered_minimum") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -40436,37 +42586,36 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedWithProratedMinimum: GroupedWithProratedMinimum) = apply { - id = groupedWithProratedMinimum.id - billableMetric = groupedWithProratedMinimum.billableMetric - billingCycleConfiguration = groupedWithProratedMinimum.billingCycleConfiguration - cadence = groupedWithProratedMinimum.cadence - conversionRate = groupedWithProratedMinimum.conversionRate - conversionRateConfig = groupedWithProratedMinimum.conversionRateConfig - createdAt = groupedWithProratedMinimum.createdAt - creditAllocation = groupedWithProratedMinimum.creditAllocation - currency = groupedWithProratedMinimum.currency - discount = groupedWithProratedMinimum.discount - externalPriceId = groupedWithProratedMinimum.externalPriceId - fixedPriceQuantity = groupedWithProratedMinimum.fixedPriceQuantity - groupedWithProratedMinimumConfig = - groupedWithProratedMinimum.groupedWithProratedMinimumConfig - invoicingCycleConfiguration = groupedWithProratedMinimum.invoicingCycleConfiguration - item = groupedWithProratedMinimum.item - maximum = groupedWithProratedMinimum.maximum - maximumAmount = groupedWithProratedMinimum.maximumAmount - metadata = groupedWithProratedMinimum.metadata - minimum = groupedWithProratedMinimum.minimum - minimumAmount = groupedWithProratedMinimum.minimumAmount - modelType = groupedWithProratedMinimum.modelType - name = groupedWithProratedMinimum.name - planPhaseOrder = groupedWithProratedMinimum.planPhaseOrder - priceType = groupedWithProratedMinimum.priceType - replacesPriceId = groupedWithProratedMinimum.replacesPriceId + internal fun from(groupedWithMeteredMinimum: GroupedWithMeteredMinimum) = apply { + id = groupedWithMeteredMinimum.id + billableMetric = groupedWithMeteredMinimum.billableMetric + billingCycleConfiguration = groupedWithMeteredMinimum.billingCycleConfiguration + cadence = groupedWithMeteredMinimum.cadence + conversionRate = groupedWithMeteredMinimum.conversionRate + conversionRateConfig = groupedWithMeteredMinimum.conversionRateConfig + createdAt = groupedWithMeteredMinimum.createdAt + creditAllocation = groupedWithMeteredMinimum.creditAllocation + currency = groupedWithMeteredMinimum.currency + discount = groupedWithMeteredMinimum.discount + externalPriceId = groupedWithMeteredMinimum.externalPriceId + fixedPriceQuantity = groupedWithMeteredMinimum.fixedPriceQuantity + groupedWithMeteredMinimumConfig = + groupedWithMeteredMinimum.groupedWithMeteredMinimumConfig + invoicingCycleConfiguration = groupedWithMeteredMinimum.invoicingCycleConfiguration + item = groupedWithMeteredMinimum.item + maximum = groupedWithMeteredMinimum.maximum + maximumAmount = groupedWithMeteredMinimum.maximumAmount + metadata = groupedWithMeteredMinimum.metadata + minimum = groupedWithMeteredMinimum.minimum + minimumAmount = groupedWithMeteredMinimum.minimumAmount + modelType = groupedWithMeteredMinimum.modelType + name = groupedWithMeteredMinimum.name + planPhaseOrder = groupedWithMeteredMinimum.planPhaseOrder + priceType = groupedWithMeteredMinimum.priceType + replacesPriceId = groupedWithMeteredMinimum.replacesPriceId dimensionalPriceConfiguration = - groupedWithProratedMinimum.dimensionalPriceConfiguration - additionalProperties = - groupedWithProratedMinimum.additionalProperties.toMutableMap() + groupedWithMeteredMinimum.dimensionalPriceConfiguration + additionalProperties = groupedWithMeteredMinimum.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -40796,20 +42945,20 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig - ) = groupedWithProratedMinimumConfig(JsonField.of(groupedWithProratedMinimumConfig)) + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + ) = groupedWithMeteredMinimumConfig(JsonField.of(groupedWithMeteredMinimumConfig)) /** - * Sets [Builder.groupedWithProratedMinimumConfig] to an arbitrary JSON value. + * Sets [Builder.groupedWithMeteredMinimumConfig] to an arbitrary JSON value. * - * You should usually call [Builder.groupedWithProratedMinimumConfig] with a well-typed - * [GroupedWithProratedMinimumConfig] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. + * You should usually call [Builder.groupedWithMeteredMinimumConfig] with a well-typed + * [GroupedWithMeteredMinimumConfig] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: JsonField - ) = apply { this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig } + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: JsonField + ) = apply { this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? @@ -40943,7 +43092,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("grouped_with_prorated_minimum") + * JsonValue.from("grouped_with_metered_minimum") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -41063,7 +43212,7 @@ private constructor( } /** - * Returns an immutable instance of [GroupedWithProratedMinimum]. + * Returns an immutable instance of [GroupedWithMeteredMinimum]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -41081,7 +43230,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedWithProratedMinimumConfig() + * .groupedWithMeteredMinimumConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -41097,8 +43246,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): GroupedWithProratedMinimum = - GroupedWithProratedMinimum( + fun build(): GroupedWithMeteredMinimum = + GroupedWithMeteredMinimum( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -41112,8 +43261,8 @@ private constructor( checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired( - "groupedWithProratedMinimumConfig", - groupedWithProratedMinimumConfig, + "groupedWithMeteredMinimumConfig", + groupedWithMeteredMinimumConfig, ), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), @@ -41134,7 +43283,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedWithProratedMinimum = apply { + fun validate(): GroupedWithMeteredMinimum = apply { if (validated) { return@apply } @@ -41151,7 +43300,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedWithProratedMinimumConfig().validate() + groupedWithMeteredMinimumConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -41160,7 +43309,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("grouped_with_prorated_minimum")) { + if (it != JsonValue.from("grouped_with_metered_minimum")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -41200,7 +43349,7 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + - (groupedWithProratedMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + + (groupedWithMeteredMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -41209,7 +43358,7 @@ private constructor( (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + modelType.let { - if (it == JsonValue.from("grouped_with_prorated_minimum")) 1 else 0 + if (it == JsonValue.from("grouped_with_metered_minimum")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + @@ -41551,7 +43700,7 @@ private constructor( } } - class GroupedWithProratedMinimumConfig + class GroupedWithMeteredMinimumConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -41568,22 +43717,22 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [GroupedWithProratedMinimumConfig]. + * [GroupedWithMeteredMinimumConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedWithProratedMinimumConfig]. */ + /** A builder for [GroupedWithMeteredMinimumConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig ) = apply { additionalProperties = - groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() + groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -41609,17 +43758,17 @@ private constructor( } /** - * Returns an immutable instance of [GroupedWithProratedMinimumConfig]. + * Returns an immutable instance of [GroupedWithMeteredMinimumConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): GroupedWithProratedMinimumConfig = - GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithMeteredMinimumConfig = + GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): GroupedWithProratedMinimumConfig = apply { + fun validate(): GroupedWithMeteredMinimumConfig = apply { if (validated) { return@apply } @@ -41650,7 +43799,7 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -41660,7 +43809,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" + "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" } /** @@ -41906,20 +44055,20 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMeteredMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithProratedMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "GroupedWithMeteredMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class GroupedWithMeteredMinimum + class MatrixWithDisplayName private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -41933,9 +44082,9 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, - private val groupedWithMeteredMinimumConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, + private val matrixWithDisplayNameConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -41984,14 +44133,13 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_metered_minimum_config") - @ExcludeMissing - groupedWithMeteredMinimumConfig: JsonField = - JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + matrixWithDisplayNameConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -42031,9 +44179,9 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, - groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, + matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, @@ -42126,13 +44274,6 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") - /** - * @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 groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = - groupedWithMeteredMinimumConfig.getRequired("grouped_with_metered_minimum_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -42146,6 +44287,13 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") + /** + * @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 matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = + matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -42185,7 +44333,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("grouped_with_metered_minimum") + * JsonValue.from("matrix_with_display_name") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -42338,17 +44486,6 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - /** - * Returns the raw JSON value of [groupedWithMeteredMinimumConfig]. - * - * Unlike [groupedWithMeteredMinimumConfig], this method doesn't throw if the JSON field has - * an unexpected type. - */ - @JsonProperty("grouped_with_metered_minimum_config") - @ExcludeMissing - fun _groupedWithMeteredMinimumConfig(): JsonField = - groupedWithMeteredMinimumConfig - /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -42367,6 +44504,17 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item + /** + * Returns the raw JSON value of [matrixWithDisplayNameConfig]. + * + * Unlike [matrixWithDisplayNameConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + fun _matrixWithDisplayNameConfig(): JsonField = + matrixWithDisplayNameConfig + /** * Returns the raw JSON value of [maximum]. * @@ -42478,8 +44626,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [GroupedWithMeteredMinimum]. + * Returns a mutable builder for constructing an instance of [MatrixWithDisplayName]. * * The following fields are required: * ```java @@ -42495,9 +44642,9 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedWithMeteredMinimumConfig() * .invoicingCycleConfiguration() * .item() + * .matrixWithDisplayNameConfig() * .maximum() * .maximumAmount() * .metadata() @@ -42512,7 +44659,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedWithMeteredMinimum]. */ + /** A builder for [MatrixWithDisplayName]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -42527,17 +44674,15 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedWithMeteredMinimumConfig: - JsonField? = - null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null + private var matrixWithDisplayNameConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("grouped_with_metered_minimum") + private var modelType: JsonValue = JsonValue.from("matrix_with_display_name") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -42547,36 +44692,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedWithMeteredMinimum: GroupedWithMeteredMinimum) = apply { - id = groupedWithMeteredMinimum.id - billableMetric = groupedWithMeteredMinimum.billableMetric - billingCycleConfiguration = groupedWithMeteredMinimum.billingCycleConfiguration - cadence = groupedWithMeteredMinimum.cadence - conversionRate = groupedWithMeteredMinimum.conversionRate - conversionRateConfig = groupedWithMeteredMinimum.conversionRateConfig - createdAt = groupedWithMeteredMinimum.createdAt - creditAllocation = groupedWithMeteredMinimum.creditAllocation - currency = groupedWithMeteredMinimum.currency - discount = groupedWithMeteredMinimum.discount - externalPriceId = groupedWithMeteredMinimum.externalPriceId - fixedPriceQuantity = groupedWithMeteredMinimum.fixedPriceQuantity - groupedWithMeteredMinimumConfig = - groupedWithMeteredMinimum.groupedWithMeteredMinimumConfig - invoicingCycleConfiguration = groupedWithMeteredMinimum.invoicingCycleConfiguration - item = groupedWithMeteredMinimum.item - maximum = groupedWithMeteredMinimum.maximum - maximumAmount = groupedWithMeteredMinimum.maximumAmount - metadata = groupedWithMeteredMinimum.metadata - minimum = groupedWithMeteredMinimum.minimum - minimumAmount = groupedWithMeteredMinimum.minimumAmount - modelType = groupedWithMeteredMinimum.modelType - name = groupedWithMeteredMinimum.name - planPhaseOrder = groupedWithMeteredMinimum.planPhaseOrder - priceType = groupedWithMeteredMinimum.priceType - replacesPriceId = groupedWithMeteredMinimum.replacesPriceId - dimensionalPriceConfiguration = - groupedWithMeteredMinimum.dimensionalPriceConfiguration - additionalProperties = groupedWithMeteredMinimum.additionalProperties.toMutableMap() + internal fun from(matrixWithDisplayName: MatrixWithDisplayName) = apply { + id = matrixWithDisplayName.id + billableMetric = matrixWithDisplayName.billableMetric + billingCycleConfiguration = matrixWithDisplayName.billingCycleConfiguration + cadence = matrixWithDisplayName.cadence + conversionRate = matrixWithDisplayName.conversionRate + conversionRateConfig = matrixWithDisplayName.conversionRateConfig + createdAt = matrixWithDisplayName.createdAt + creditAllocation = matrixWithDisplayName.creditAllocation + currency = matrixWithDisplayName.currency + discount = matrixWithDisplayName.discount + externalPriceId = matrixWithDisplayName.externalPriceId + fixedPriceQuantity = matrixWithDisplayName.fixedPriceQuantity + invoicingCycleConfiguration = matrixWithDisplayName.invoicingCycleConfiguration + item = matrixWithDisplayName.item + matrixWithDisplayNameConfig = matrixWithDisplayName.matrixWithDisplayNameConfig + maximum = matrixWithDisplayName.maximum + maximumAmount = matrixWithDisplayName.maximumAmount + metadata = matrixWithDisplayName.metadata + minimum = matrixWithDisplayName.minimum + minimumAmount = matrixWithDisplayName.minimumAmount + modelType = matrixWithDisplayName.modelType + name = matrixWithDisplayName.name + planPhaseOrder = matrixWithDisplayName.planPhaseOrder + priceType = matrixWithDisplayName.priceType + replacesPriceId = matrixWithDisplayName.replacesPriceId + dimensionalPriceConfiguration = matrixWithDisplayName.dimensionalPriceConfiguration + additionalProperties = matrixWithDisplayName.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -42906,21 +45049,6 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = groupedWithMeteredMinimumConfig(JsonField.of(groupedWithMeteredMinimumConfig)) - - /** - * Sets [Builder.groupedWithMeteredMinimumConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.groupedWithMeteredMinimumConfig] with a well-typed - * [GroupedWithMeteredMinimumConfig] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: JsonField - ) = apply { this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } - fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -42955,6 +45083,21 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } + fun matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig + ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) + + /** + * Sets [Builder.matrixWithDisplayNameConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.matrixWithDisplayNameConfig] with a well-typed + * [MatrixWithDisplayNameConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: JsonField + ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -43053,7 +45196,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("grouped_with_metered_minimum") + * JsonValue.from("matrix_with_display_name") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -43173,7 +45316,7 @@ private constructor( } /** - * Returns an immutable instance of [GroupedWithMeteredMinimum]. + * Returns an immutable instance of [MatrixWithDisplayName]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -43191,9 +45334,9 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedWithMeteredMinimumConfig() * .invoicingCycleConfiguration() * .item() + * .matrixWithDisplayNameConfig() * .maximum() * .maximumAmount() * .metadata() @@ -43207,8 +45350,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): GroupedWithMeteredMinimum = - GroupedWithMeteredMinimum( + fun build(): MatrixWithDisplayName = + MatrixWithDisplayName( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -43221,12 +45364,9 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired( - "groupedWithMeteredMinimumConfig", - groupedWithMeteredMinimumConfig, - ), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), + checkRequired("matrixWithDisplayNameConfig", matrixWithDisplayNameConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -43244,7 +45384,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedWithMeteredMinimum = apply { + fun validate(): MatrixWithDisplayName = apply { if (validated) { return@apply } @@ -43261,16 +45401,16 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedWithMeteredMinimumConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() + matrixWithDisplayNameConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("grouped_with_metered_minimum")) { + if (it != JsonValue.from("matrix_with_display_name")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -43310,17 +45450,15 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + - (groupedWithMeteredMinimumConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + + (matrixWithDisplayNameConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { - if (it == JsonValue.from("grouped_with_metered_minimum")) 1 else 0 - } + + modelType.let { if (it == JsonValue.from("matrix_with_display_name")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + @@ -43661,7 +45799,7 @@ private constructor( } } - class GroupedWithMeteredMinimumConfig + class MatrixWithDisplayNameConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -43678,23 +45816,22 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [GroupedWithMeteredMinimumConfig]. + * [MatrixWithDisplayNameConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedWithMeteredMinimumConfig]. */ + /** A builder for [MatrixWithDisplayNameConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = apply { - additionalProperties = - groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() - } + internal fun from(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = + apply { + additionalProperties = + matrixWithDisplayNameConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -43719,17 +45856,17 @@ private constructor( } /** - * Returns an immutable instance of [GroupedWithMeteredMinimumConfig]. + * Returns an immutable instance of [MatrixWithDisplayNameConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): GroupedWithMeteredMinimumConfig = - GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) + fun build(): MatrixWithDisplayNameConfig = + MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): GroupedWithMeteredMinimumConfig = apply { + fun validate(): MatrixWithDisplayNameConfig = apply { if (validated) { return@apply } @@ -43760,7 +45897,7 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -43770,7 +45907,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" + "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" } /** @@ -44016,24 +46153,25 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithMeteredMinimum && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithDisplayName && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimum{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "MatrixWithDisplayName{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class MatrixWithDisplayName + class BulkWithProration private constructor( private val id: JsonField, private val billableMetric: JsonField, private val billingCycleConfiguration: JsonField, + private val bulkWithProrationConfig: JsonField, private val cadence: JsonField, private val conversionRate: JsonField, private val conversionRateConfig: JsonField, @@ -44045,7 +46183,6 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, - private val matrixWithDisplayNameConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -44069,6 +46206,9 @@ private constructor( @JsonProperty("billing_cycle_configuration") @ExcludeMissing billingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + bulkWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), @JsonProperty("conversion_rate") @ExcludeMissing @@ -44098,9 +46238,6 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - matrixWithDisplayNameConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -44131,6 +46268,7 @@ private constructor( id, billableMetric, billingCycleConfiguration, + bulkWithProrationConfig, cadence, conversionRate, conversionRateConfig, @@ -44142,7 +46280,6 @@ private constructor( fixedPriceQuantity, invoicingCycleConfiguration, item, - matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, @@ -44177,6 +46314,13 @@ private constructor( fun billingCycleConfiguration(): BillingCycleConfiguration = billingCycleConfiguration.getRequired("billing_cycle_configuration") + /** + * @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 bulkWithProrationConfig(): BulkWithProrationConfig = + bulkWithProrationConfig.getRequired("bulk_with_proration_config") + /** * @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). @@ -44248,13 +46392,6 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") - /** - * @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 matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = - matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -44294,7 +46431,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("matrix_with_display_name") + * JsonValue.from("bulk_with_proration") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -44364,6 +46501,16 @@ private constructor( fun _billingCycleConfiguration(): JsonField = billingCycleConfiguration + /** + * Returns the raw JSON value of [bulkWithProrationConfig]. + * + * Unlike [bulkWithProrationConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + fun _bulkWithProrationConfig(): JsonField = bulkWithProrationConfig + /** * Returns the raw JSON value of [cadence]. * @@ -44465,17 +46612,6 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - /** - * Returns the raw JSON value of [matrixWithDisplayNameConfig]. - * - * Unlike [matrixWithDisplayNameConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - fun _matrixWithDisplayNameConfig(): JsonField = - matrixWithDisplayNameConfig - /** * Returns the raw JSON value of [maximum]. * @@ -44587,13 +46723,14 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MatrixWithDisplayName]. + * Returns a mutable builder for constructing an instance of [BulkWithProration]. * * The following fields are required: * ```java * .id() * .billableMetric() * .billingCycleConfiguration() + * .bulkWithProrationConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -44605,7 +46742,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .matrixWithDisplayNameConfig() * .maximum() * .maximumAmount() * .metadata() @@ -44620,12 +46756,13 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MatrixWithDisplayName]. */ + /** A builder for [BulkWithProration]. */ class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null + private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var conversionRateConfig: JsonField? = null @@ -44637,13 +46774,12 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var matrixWithDisplayNameConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("matrix_with_display_name") + private var modelType: JsonValue = JsonValue.from("bulk_with_proration") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -44653,34 +46789,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(matrixWithDisplayName: MatrixWithDisplayName) = apply { - id = matrixWithDisplayName.id - billableMetric = matrixWithDisplayName.billableMetric - billingCycleConfiguration = matrixWithDisplayName.billingCycleConfiguration - cadence = matrixWithDisplayName.cadence - conversionRate = matrixWithDisplayName.conversionRate - conversionRateConfig = matrixWithDisplayName.conversionRateConfig - createdAt = matrixWithDisplayName.createdAt - creditAllocation = matrixWithDisplayName.creditAllocation - currency = matrixWithDisplayName.currency - discount = matrixWithDisplayName.discount - externalPriceId = matrixWithDisplayName.externalPriceId - fixedPriceQuantity = matrixWithDisplayName.fixedPriceQuantity - invoicingCycleConfiguration = matrixWithDisplayName.invoicingCycleConfiguration - item = matrixWithDisplayName.item - matrixWithDisplayNameConfig = matrixWithDisplayName.matrixWithDisplayNameConfig - maximum = matrixWithDisplayName.maximum - maximumAmount = matrixWithDisplayName.maximumAmount - metadata = matrixWithDisplayName.metadata - minimum = matrixWithDisplayName.minimum - minimumAmount = matrixWithDisplayName.minimumAmount - modelType = matrixWithDisplayName.modelType - name = matrixWithDisplayName.name - planPhaseOrder = matrixWithDisplayName.planPhaseOrder - priceType = matrixWithDisplayName.priceType - replacesPriceId = matrixWithDisplayName.replacesPriceId - dimensionalPriceConfiguration = matrixWithDisplayName.dimensionalPriceConfiguration - additionalProperties = matrixWithDisplayName.additionalProperties.toMutableMap() + internal fun from(bulkWithProration: BulkWithProration) = apply { + id = bulkWithProration.id + billableMetric = bulkWithProration.billableMetric + billingCycleConfiguration = bulkWithProration.billingCycleConfiguration + bulkWithProrationConfig = bulkWithProration.bulkWithProrationConfig + cadence = bulkWithProration.cadence + conversionRate = bulkWithProration.conversionRate + conversionRateConfig = bulkWithProration.conversionRateConfig + createdAt = bulkWithProration.createdAt + creditAllocation = bulkWithProration.creditAllocation + currency = bulkWithProration.currency + discount = bulkWithProration.discount + externalPriceId = bulkWithProration.externalPriceId + fixedPriceQuantity = bulkWithProration.fixedPriceQuantity + invoicingCycleConfiguration = bulkWithProration.invoicingCycleConfiguration + item = bulkWithProration.item + maximum = bulkWithProration.maximum + maximumAmount = bulkWithProration.maximumAmount + metadata = bulkWithProration.metadata + minimum = bulkWithProration.minimum + minimumAmount = bulkWithProration.minimumAmount + modelType = bulkWithProration.modelType + name = bulkWithProration.name + planPhaseOrder = bulkWithProration.planPhaseOrder + priceType = bulkWithProration.priceType + replacesPriceId = bulkWithProration.replacesPriceId + dimensionalPriceConfiguration = bulkWithProration.dimensionalPriceConfiguration + additionalProperties = bulkWithProration.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -44726,6 +46862,20 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } + fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = + bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) + + /** + * Sets [Builder.bulkWithProrationConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.bulkWithProrationConfig] with a well-typed + * [BulkWithProrationConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun bulkWithProrationConfig( + bulkWithProrationConfig: JsonField + ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } + fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) /** @@ -45044,21 +47194,6 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig - ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) - - /** - * Sets [Builder.matrixWithDisplayNameConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.matrixWithDisplayNameConfig] with a well-typed - * [MatrixWithDisplayNameConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: JsonField - ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } - @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -45157,7 +47292,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("matrix_with_display_name") + * JsonValue.from("bulk_with_proration") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -45277,7 +47412,7 @@ private constructor( } /** - * Returns an immutable instance of [MatrixWithDisplayName]. + * Returns an immutable instance of [BulkWithProration]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -45286,6 +47421,7 @@ private constructor( * .id() * .billableMetric() * .billingCycleConfiguration() + * .bulkWithProrationConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -45297,7 +47433,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .matrixWithDisplayNameConfig() * .maximum() * .maximumAmount() * .metadata() @@ -45311,11 +47446,12 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MatrixWithDisplayName = - MatrixWithDisplayName( + fun build(): BulkWithProration = + BulkWithProration( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), + checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("conversionRateConfig", conversionRateConfig), @@ -45327,7 +47463,6 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("matrixWithDisplayNameConfig", matrixWithDisplayNameConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -45345,7 +47480,7 @@ private constructor( private var validated: Boolean = false - fun validate(): MatrixWithDisplayName = apply { + fun validate(): BulkWithProration = apply { if (validated) { return@apply } @@ -45353,6 +47488,7 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() + bulkWithProrationConfig().validate() cadence().validate() conversionRate() conversionRateConfig().ifPresent { it.validate() } @@ -45364,14 +47500,13 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - matrixWithDisplayNameConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("matrix_with_display_name")) { + if (it != JsonValue.from("bulk_with_proration")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -45402,6 +47537,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + + (bulkWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + (cadence.asKnown().getOrNull()?.validity() ?: 0) + (if (conversionRate.asKnown().isPresent) 1 else 0) + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + @@ -45413,19 +47549,128 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + - (matrixWithDisplayNameConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("matrix_with_display_name")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("bulk_with_proration")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) + class BulkWithProrationConfig + @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 + * [BulkWithProrationConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(bulkWithProrationConfig: BulkWithProrationConfig) = apply { + additionalProperties = + bulkWithProrationConfig.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [BulkWithProrationConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): BulkWithProrationConfig = + BulkWithProrationConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): BulkWithProrationConfig = 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 /* spotless:off */ other is BulkWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "BulkWithProrationConfig{additionalProperties=$additionalProperties}" + } + class Cadence @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -45760,117 +48005,6 @@ private constructor( } } - class MatrixWithDisplayNameConfig - @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 - * [MatrixWithDisplayNameConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [MatrixWithDisplayNameConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = - apply { - additionalProperties = - matrixWithDisplayNameConfig.additionalProperties.toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [MatrixWithDisplayNameConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): MatrixWithDisplayNameConfig = - MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): MatrixWithDisplayNameConfig = 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 /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" - } - /** * 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 @@ -46114,25 +48248,24 @@ private constructor( return true } - return /* spotless:off */ other is MatrixWithDisplayName && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BulkWithProration && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkWithProrationConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithDisplayName{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "BulkWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, 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}" } - class BulkWithProration + class GroupedTieredPackage private constructor( private val id: JsonField, private val billableMetric: JsonField, private val billingCycleConfiguration: JsonField, - private val bulkWithProrationConfig: JsonField, private val cadence: JsonField, private val conversionRate: JsonField, private val conversionRateConfig: JsonField, @@ -46142,6 +48275,7 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, + private val groupedTieredPackageConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -46167,9 +48301,6 @@ private constructor( @JsonProperty("billing_cycle_configuration") @ExcludeMissing billingCycleConfiguration: JsonField = JsonMissing.of(), - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - bulkWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing cadence: JsonField = JsonMissing.of(), @JsonProperty("conversion_rate") @ExcludeMissing @@ -46195,6 +48326,9 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + groupedTieredPackageConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @@ -46229,7 +48363,6 @@ private constructor( id, billableMetric, billingCycleConfiguration, - bulkWithProrationConfig, cadence, conversionRate, conversionRateConfig, @@ -46239,6 +48372,7 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, + groupedTieredPackageConfig, invoicingCycleConfiguration, item, maximum, @@ -46275,13 +48409,6 @@ private constructor( fun billingCycleConfiguration(): BillingCycleConfiguration = billingCycleConfiguration.getRequired("billing_cycle_configuration") - /** - * @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 bulkWithProrationConfig(): BulkWithProrationConfig = - bulkWithProrationConfig.getRequired("bulk_with_proration_config") - /** * @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). @@ -46340,6 +48467,13 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") + /** + * @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 groupedTieredPackageConfig(): GroupedTieredPackageConfig = + groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -46392,7 +48526,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("bulk_with_proration") + * JsonValue.from("grouped_tiered_package") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -46462,16 +48596,6 @@ private constructor( fun _billingCycleConfiguration(): JsonField = billingCycleConfiguration - /** - * Returns the raw JSON value of [bulkWithProrationConfig]. - * - * Unlike [bulkWithProrationConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - fun _bulkWithProrationConfig(): JsonField = bulkWithProrationConfig - /** * Returns the raw JSON value of [cadence]. * @@ -46555,6 +48679,17 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + /** + * Returns the raw JSON value of [groupedTieredPackageConfig]. + * + * Unlike [groupedTieredPackageConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + fun _groupedTieredPackageConfig(): JsonField = + groupedTieredPackageConfig + /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -46684,14 +48819,13 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [BulkWithProration]. + * Returns a mutable builder for constructing an instance of [GroupedTieredPackage]. * * The following fields are required: * ```java * .id() * .billableMetric() * .billingCycleConfiguration() - * .bulkWithProrationConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -46701,6 +48835,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedTieredPackageConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -46717,13 +48852,12 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BulkWithProration]. */ + /** A builder for [GroupedTieredPackage]. */ class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null - private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var conversionRateConfig: JsonField? = null @@ -46733,6 +48867,7 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null + private var groupedTieredPackageConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -46740,7 +48875,7 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("bulk_with_proration") + private var modelType: JsonValue = JsonValue.from("grouped_tiered_package") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -46750,34 +48885,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bulkWithProration: BulkWithProration) = apply { - id = bulkWithProration.id - billableMetric = bulkWithProration.billableMetric - billingCycleConfiguration = bulkWithProration.billingCycleConfiguration - bulkWithProrationConfig = bulkWithProration.bulkWithProrationConfig - cadence = bulkWithProration.cadence - conversionRate = bulkWithProration.conversionRate - conversionRateConfig = bulkWithProration.conversionRateConfig - createdAt = bulkWithProration.createdAt - creditAllocation = bulkWithProration.creditAllocation - currency = bulkWithProration.currency - discount = bulkWithProration.discount - externalPriceId = bulkWithProration.externalPriceId - fixedPriceQuantity = bulkWithProration.fixedPriceQuantity - invoicingCycleConfiguration = bulkWithProration.invoicingCycleConfiguration - item = bulkWithProration.item - maximum = bulkWithProration.maximum - maximumAmount = bulkWithProration.maximumAmount - metadata = bulkWithProration.metadata - minimum = bulkWithProration.minimum - minimumAmount = bulkWithProration.minimumAmount - modelType = bulkWithProration.modelType - name = bulkWithProration.name - planPhaseOrder = bulkWithProration.planPhaseOrder - priceType = bulkWithProration.priceType - replacesPriceId = bulkWithProration.replacesPriceId - dimensionalPriceConfiguration = bulkWithProration.dimensionalPriceConfiguration - additionalProperties = bulkWithProration.additionalProperties.toMutableMap() + internal fun from(groupedTieredPackage: GroupedTieredPackage) = apply { + id = groupedTieredPackage.id + billableMetric = groupedTieredPackage.billableMetric + billingCycleConfiguration = groupedTieredPackage.billingCycleConfiguration + cadence = groupedTieredPackage.cadence + conversionRate = groupedTieredPackage.conversionRate + conversionRateConfig = groupedTieredPackage.conversionRateConfig + createdAt = groupedTieredPackage.createdAt + creditAllocation = groupedTieredPackage.creditAllocation + currency = groupedTieredPackage.currency + discount = groupedTieredPackage.discount + externalPriceId = groupedTieredPackage.externalPriceId + fixedPriceQuantity = groupedTieredPackage.fixedPriceQuantity + groupedTieredPackageConfig = groupedTieredPackage.groupedTieredPackageConfig + invoicingCycleConfiguration = groupedTieredPackage.invoicingCycleConfiguration + item = groupedTieredPackage.item + maximum = groupedTieredPackage.maximum + maximumAmount = groupedTieredPackage.maximumAmount + metadata = groupedTieredPackage.metadata + minimum = groupedTieredPackage.minimum + minimumAmount = groupedTieredPackage.minimumAmount + modelType = groupedTieredPackage.modelType + name = groupedTieredPackage.name + planPhaseOrder = groupedTieredPackage.planPhaseOrder + priceType = groupedTieredPackage.priceType + replacesPriceId = groupedTieredPackage.replacesPriceId + dimensionalPriceConfiguration = groupedTieredPackage.dimensionalPriceConfiguration + additionalProperties = groupedTieredPackage.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -46823,20 +48958,6 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } - fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = - bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) - - /** - * Sets [Builder.bulkWithProrationConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.bulkWithProrationConfig] with a well-typed - * [BulkWithProrationConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun bulkWithProrationConfig( - bulkWithProrationConfig: JsonField - ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } - fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) /** @@ -47121,6 +49242,20 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } + fun groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = + groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) + + /** + * Sets [Builder.groupedTieredPackageConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.groupedTieredPackageConfig] with a well-typed + * [GroupedTieredPackageConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun groupedTieredPackageConfig( + groupedTieredPackageConfig: JsonField + ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } + fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -47253,7 +49388,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("bulk_with_proration") + * JsonValue.from("grouped_tiered_package") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -47373,7 +49508,7 @@ private constructor( } /** - * Returns an immutable instance of [BulkWithProration]. + * Returns an immutable instance of [GroupedTieredPackage]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -47382,7 +49517,6 @@ private constructor( * .id() * .billableMetric() * .billingCycleConfiguration() - * .bulkWithProrationConfig() * .cadence() * .conversionRate() * .conversionRateConfig() @@ -47392,6 +49526,7 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedTieredPackageConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -47407,12 +49542,11 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BulkWithProration = - BulkWithProration( + fun build(): GroupedTieredPackage = + GroupedTieredPackage( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), - checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("conversionRateConfig", conversionRateConfig), @@ -47422,6 +49556,7 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -47441,7 +49576,7 @@ private constructor( private var validated: Boolean = false - fun validate(): BulkWithProration = apply { + fun validate(): GroupedTieredPackage = apply { if (validated) { return@apply } @@ -47449,7 +49584,6 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() - bulkWithProrationConfig().validate() cadence().validate() conversionRate() conversionRateConfig().ifPresent { it.validate() } @@ -47459,6 +49593,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() + groupedTieredPackageConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -47467,7 +49602,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("bulk_with_proration")) { + if (it != JsonValue.from("grouped_tiered_package")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -47498,7 +49633,6 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (billableMetric.asKnown().getOrNull()?.validity() ?: 0) + (billingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + - (bulkWithProrationConfig.asKnown().getOrNull()?.validity() ?: 0) + (cadence.asKnown().getOrNull()?.validity() ?: 0) + (if (conversionRate.asKnown().isPresent) 1 else 0) + (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + @@ -47508,6 +49642,7 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + + (groupedTieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -47515,123 +49650,13 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("bulk_with_proration")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("grouped_tiered_package")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) - class BulkWithProrationConfig - @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 - * [BulkWithProrationConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [BulkWithProrationConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(bulkWithProrationConfig: BulkWithProrationConfig) = apply { - additionalProperties = - bulkWithProrationConfig.additionalProperties.toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [BulkWithProrationConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): BulkWithProrationConfig = - BulkWithProrationConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): BulkWithProrationConfig = 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 /* spotless:off */ other is BulkWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "BulkWithProrationConfig{additionalProperties=$additionalProperties}" - } - class Cadence @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -47966,6 +49991,116 @@ private constructor( } } + class GroupedTieredPackageConfig + @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 + * [GroupedTieredPackageConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [GroupedTieredPackageConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { + additionalProperties = + groupedTieredPackageConfig.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [GroupedTieredPackageConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): GroupedTieredPackageConfig = + GroupedTieredPackageConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): GroupedTieredPackageConfig = 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 /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" + } + /** * 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 @@ -48209,20 +50344,20 @@ private constructor( return true } - return /* spotless:off */ other is BulkWithProration && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedTieredPackage && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedTieredPackageConfig == other.groupedTieredPackageConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkWithProrationConfig, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedTieredPackageConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithProration{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, 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}" + "GroupedTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class GroupedTieredPackage + class MaxGroupTieredPackage private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -48236,9 +50371,9 @@ private constructor( private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, - private val groupedTieredPackageConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, + private val maxGroupTieredPackageConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -48287,13 +50422,13 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - groupedTieredPackageConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), + @JsonProperty("max_group_tiered_package_config") + @ExcludeMissing + maxGroupTieredPackageConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -48333,9 +50468,9 @@ private constructor( discount, externalPriceId, fixedPriceQuantity, - groupedTieredPackageConfig, invoicingCycleConfiguration, item, + maxGroupTieredPackageConfig, maximum, maximumAmount, metadata, @@ -48428,13 +50563,6 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") - /** - * @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 groupedTieredPackageConfig(): GroupedTieredPackageConfig = - groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -48448,6 +50576,13 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") + /** + * @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 maxGroupTieredPackageConfig(): MaxGroupTieredPackageConfig = + maxGroupTieredPackageConfig.getRequired("max_group_tiered_package_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -48487,7 +50622,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("grouped_tiered_package") + * JsonValue.from("max_group_tiered_package") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -48640,17 +50775,6 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - /** - * Returns the raw JSON value of [groupedTieredPackageConfig]. - * - * Unlike [groupedTieredPackageConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - fun _groupedTieredPackageConfig(): JsonField = - groupedTieredPackageConfig - /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -48669,6 +50793,17 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item + /** + * Returns the raw JSON value of [maxGroupTieredPackageConfig]. + * + * Unlike [maxGroupTieredPackageConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("max_group_tiered_package_config") + @ExcludeMissing + fun _maxGroupTieredPackageConfig(): JsonField = + maxGroupTieredPackageConfig + /** * Returns the raw JSON value of [maximum]. * @@ -48780,7 +50915,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [GroupedTieredPackage]. + * Returns a mutable builder for constructing an instance of [MaxGroupTieredPackage]. * * The following fields are required: * ```java @@ -48796,9 +50931,9 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedTieredPackageConfig() * .invoicingCycleConfiguration() * .item() + * .maxGroupTieredPackageConfig() * .maximum() * .maximumAmount() * .metadata() @@ -48813,7 +50948,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedTieredPackage]. */ + /** A builder for [MaxGroupTieredPackage]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -48828,15 +50963,15 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedTieredPackageConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null + private var maxGroupTieredPackageConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("grouped_tiered_package") + private var modelType: JsonValue = JsonValue.from("max_group_tiered_package") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -48846,34 +50981,34 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedTieredPackage: GroupedTieredPackage) = apply { - id = groupedTieredPackage.id - billableMetric = groupedTieredPackage.billableMetric - billingCycleConfiguration = groupedTieredPackage.billingCycleConfiguration - cadence = groupedTieredPackage.cadence - conversionRate = groupedTieredPackage.conversionRate - conversionRateConfig = groupedTieredPackage.conversionRateConfig - createdAt = groupedTieredPackage.createdAt - creditAllocation = groupedTieredPackage.creditAllocation - currency = groupedTieredPackage.currency - discount = groupedTieredPackage.discount - externalPriceId = groupedTieredPackage.externalPriceId - fixedPriceQuantity = groupedTieredPackage.fixedPriceQuantity - groupedTieredPackageConfig = groupedTieredPackage.groupedTieredPackageConfig - invoicingCycleConfiguration = groupedTieredPackage.invoicingCycleConfiguration - item = groupedTieredPackage.item - maximum = groupedTieredPackage.maximum - maximumAmount = groupedTieredPackage.maximumAmount - metadata = groupedTieredPackage.metadata - minimum = groupedTieredPackage.minimum - minimumAmount = groupedTieredPackage.minimumAmount - modelType = groupedTieredPackage.modelType - name = groupedTieredPackage.name - planPhaseOrder = groupedTieredPackage.planPhaseOrder - priceType = groupedTieredPackage.priceType - replacesPriceId = groupedTieredPackage.replacesPriceId - dimensionalPriceConfiguration = groupedTieredPackage.dimensionalPriceConfiguration - additionalProperties = groupedTieredPackage.additionalProperties.toMutableMap() + internal fun from(maxGroupTieredPackage: MaxGroupTieredPackage) = apply { + id = maxGroupTieredPackage.id + billableMetric = maxGroupTieredPackage.billableMetric + billingCycleConfiguration = maxGroupTieredPackage.billingCycleConfiguration + cadence = maxGroupTieredPackage.cadence + conversionRate = maxGroupTieredPackage.conversionRate + conversionRateConfig = maxGroupTieredPackage.conversionRateConfig + createdAt = maxGroupTieredPackage.createdAt + creditAllocation = maxGroupTieredPackage.creditAllocation + currency = maxGroupTieredPackage.currency + discount = maxGroupTieredPackage.discount + externalPriceId = maxGroupTieredPackage.externalPriceId + fixedPriceQuantity = maxGroupTieredPackage.fixedPriceQuantity + invoicingCycleConfiguration = maxGroupTieredPackage.invoicingCycleConfiguration + item = maxGroupTieredPackage.item + maxGroupTieredPackageConfig = maxGroupTieredPackage.maxGroupTieredPackageConfig + maximum = maxGroupTieredPackage.maximum + maximumAmount = maxGroupTieredPackage.maximumAmount + metadata = maxGroupTieredPackage.metadata + minimum = maxGroupTieredPackage.minimum + minimumAmount = maxGroupTieredPackage.minimumAmount + modelType = maxGroupTieredPackage.modelType + name = maxGroupTieredPackage.name + planPhaseOrder = maxGroupTieredPackage.planPhaseOrder + priceType = maxGroupTieredPackage.priceType + replacesPriceId = maxGroupTieredPackage.replacesPriceId + dimensionalPriceConfiguration = maxGroupTieredPackage.dimensionalPriceConfiguration + additionalProperties = maxGroupTieredPackage.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -49203,20 +51338,6 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = - groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) - - /** - * Sets [Builder.groupedTieredPackageConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.groupedTieredPackageConfig] with a well-typed - * [GroupedTieredPackageConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun groupedTieredPackageConfig( - groupedTieredPackageConfig: JsonField - ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } - fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -49251,6 +51372,21 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } + fun maxGroupTieredPackageConfig( + maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig + ) = maxGroupTieredPackageConfig(JsonField.of(maxGroupTieredPackageConfig)) + + /** + * Sets [Builder.maxGroupTieredPackageConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.maxGroupTieredPackageConfig] with a well-typed + * [MaxGroupTieredPackageConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun maxGroupTieredPackageConfig( + maxGroupTieredPackageConfig: JsonField + ) = apply { this.maxGroupTieredPackageConfig = maxGroupTieredPackageConfig } + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -49349,7 +51485,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("grouped_tiered_package") + * JsonValue.from("max_group_tiered_package") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -49469,7 +51605,7 @@ private constructor( } /** - * Returns an immutable instance of [GroupedTieredPackage]. + * Returns an immutable instance of [MaxGroupTieredPackage]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -49487,9 +51623,9 @@ private constructor( * .discount() * .externalPriceId() * .fixedPriceQuantity() - * .groupedTieredPackageConfig() * .invoicingCycleConfiguration() * .item() + * .maxGroupTieredPackageConfig() * .maximum() * .maximumAmount() * .metadata() @@ -49503,8 +51639,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): GroupedTieredPackage = - GroupedTieredPackage( + fun build(): MaxGroupTieredPackage = + MaxGroupTieredPackage( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -49517,9 +51653,9 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), + checkRequired("maxGroupTieredPackageConfig", maxGroupTieredPackageConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -49537,7 +51673,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedTieredPackage = apply { + fun validate(): MaxGroupTieredPackage = apply { if (validated) { return@apply } @@ -49554,16 +51690,16 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedTieredPackageConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() + maxGroupTieredPackageConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("grouped_tiered_package")) { + if (it != JsonValue.from("max_group_tiered_package")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -49603,15 +51739,15 @@ private constructor( (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + - (groupedTieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + + (maxGroupTieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("grouped_tiered_package")) 1 else 0 } + + modelType.let { if (it == JsonValue.from("max_group_tiered_package")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + @@ -49952,7 +52088,7 @@ private constructor( } } - class GroupedTieredPackageConfig + class MaxGroupTieredPackageConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -49969,21 +52105,22 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [GroupedTieredPackageConfig]. + * [MaxGroupTieredPackageConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [GroupedTieredPackageConfig]. */ + /** A builder for [MaxGroupTieredPackageConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { - additionalProperties = - groupedTieredPackageConfig.additionalProperties.toMutableMap() - } + internal fun from(maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig) = + apply { + additionalProperties = + maxGroupTieredPackageConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -50008,17 +52145,17 @@ private constructor( } /** - * Returns an immutable instance of [GroupedTieredPackageConfig]. + * Returns an immutable instance of [MaxGroupTieredPackageConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): GroupedTieredPackageConfig = - GroupedTieredPackageConfig(additionalProperties.toImmutable()) + fun build(): MaxGroupTieredPackageConfig = + MaxGroupTieredPackageConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): GroupedTieredPackageConfig = apply { + fun validate(): MaxGroupTieredPackageConfig = apply { if (validated) { return@apply } @@ -50049,7 +52186,7 @@ private constructor( return true } - return /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaxGroupTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -50059,7 +52196,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" + "MaxGroupTieredPackageConfig{additionalProperties=$additionalProperties}" } /** @@ -50305,20 +52442,20 @@ private constructor( return true } - return /* spotless:off */ other is GroupedTieredPackage && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedTieredPackageConfig == other.groupedTieredPackageConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaxGroupTieredPackage && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maxGroupTieredPackageConfig == other.maxGroupTieredPackageConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedTieredPackageConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maxGroupTieredPackageConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "MaxGroupTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class MaxGroupTieredPackage + class ScalableMatrixWithUnitPricing private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -50334,7 +52471,6 @@ private constructor( private val fixedPriceQuantity: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, - private val maxGroupTieredPackageConfig: JsonField, private val maximum: JsonField, private val maximumAmount: JsonField, private val metadata: JsonField, @@ -50345,6 +52481,8 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, + private val scalableMatrixWithUnitPricingConfig: + JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -50387,9 +52525,6 @@ private constructor( @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing item: JsonField = JsonMissing.of(), - @JsonProperty("max_group_tiered_package_config") - @ExcludeMissing - maxGroupTieredPackageConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing maximum: JsonField = JsonMissing.of(), @JsonProperty("maximum_amount") @ExcludeMissing @@ -50412,6 +52547,10 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + scalableMatrixWithUnitPricingConfig: JsonField = + JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -50431,7 +52570,6 @@ private constructor( fixedPriceQuantity, invoicingCycleConfiguration, item, - maxGroupTieredPackageConfig, maximum, maximumAmount, metadata, @@ -50442,6 +52580,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, + scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -50537,13 +52676,6 @@ private constructor( */ fun item(): ItemSlim = item.getRequired("item") - /** - * @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 maxGroupTieredPackageConfig(): MaxGroupTieredPackageConfig = - maxGroupTieredPackageConfig.getRequired("max_group_tiered_package_config") - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -50583,7 +52715,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("max_group_tiered_package") + * JsonValue.from("scalable_matrix_with_unit_pricing") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -50618,6 +52750,15 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 scalableMatrixWithUnitPricingConfig(): ScalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingConfig.getRequired( + "scalable_matrix_with_unit_pricing_config" + ) + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -50754,17 +52895,6 @@ private constructor( */ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - /** - * Returns the raw JSON value of [maxGroupTieredPackageConfig]. - * - * Unlike [maxGroupTieredPackageConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("max_group_tiered_package_config") - @ExcludeMissing - fun _maxGroupTieredPackageConfig(): JsonField = - maxGroupTieredPackageConfig - /** * Returns the raw JSON value of [maximum]. * @@ -50850,6 +52980,17 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId + /** + * Returns the raw JSON value of [scalableMatrixWithUnitPricingConfig]. + * + * Unlike [scalableMatrixWithUnitPricingConfig], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithUnitPricingConfig(): JsonField = + scalableMatrixWithUnitPricingConfig + /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -50876,7 +53017,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MaxGroupTieredPackage]. + * Returns a mutable builder for constructing an instance of + * [ScalableMatrixWithUnitPricing]. * * The following fields are required: * ```java @@ -50894,7 +53036,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .maxGroupTieredPackageConfig() * .maximum() * .maximumAmount() * .metadata() @@ -50904,12 +53045,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .scalableMatrixWithUnitPricingConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [MaxGroupTieredPackage]. */ + /** A builder for [ScalableMatrixWithUnitPricing]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -50926,51 +53068,59 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var maxGroupTieredPackageConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("max_group_tiered_package") + private var modelType: JsonValue = JsonValue.from("scalable_matrix_with_unit_pricing") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null + private var scalableMatrixWithUnitPricingConfig: + JsonField? = + null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(maxGroupTieredPackage: MaxGroupTieredPackage) = apply { - id = maxGroupTieredPackage.id - billableMetric = maxGroupTieredPackage.billableMetric - billingCycleConfiguration = maxGroupTieredPackage.billingCycleConfiguration - cadence = maxGroupTieredPackage.cadence - conversionRate = maxGroupTieredPackage.conversionRate - conversionRateConfig = maxGroupTieredPackage.conversionRateConfig - createdAt = maxGroupTieredPackage.createdAt - creditAllocation = maxGroupTieredPackage.creditAllocation - currency = maxGroupTieredPackage.currency - discount = maxGroupTieredPackage.discount - externalPriceId = maxGroupTieredPackage.externalPriceId - fixedPriceQuantity = maxGroupTieredPackage.fixedPriceQuantity - invoicingCycleConfiguration = maxGroupTieredPackage.invoicingCycleConfiguration - item = maxGroupTieredPackage.item - maxGroupTieredPackageConfig = maxGroupTieredPackage.maxGroupTieredPackageConfig - maximum = maxGroupTieredPackage.maximum - maximumAmount = maxGroupTieredPackage.maximumAmount - metadata = maxGroupTieredPackage.metadata - minimum = maxGroupTieredPackage.minimum - minimumAmount = maxGroupTieredPackage.minimumAmount - modelType = maxGroupTieredPackage.modelType - name = maxGroupTieredPackage.name - planPhaseOrder = maxGroupTieredPackage.planPhaseOrder - priceType = maxGroupTieredPackage.priceType - replacesPriceId = maxGroupTieredPackage.replacesPriceId - dimensionalPriceConfiguration = maxGroupTieredPackage.dimensionalPriceConfiguration - additionalProperties = maxGroupTieredPackage.additionalProperties.toMutableMap() - } + internal fun from(scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing) = + apply { + id = scalableMatrixWithUnitPricing.id + billableMetric = scalableMatrixWithUnitPricing.billableMetric + billingCycleConfiguration = + scalableMatrixWithUnitPricing.billingCycleConfiguration + cadence = scalableMatrixWithUnitPricing.cadence + conversionRate = scalableMatrixWithUnitPricing.conversionRate + conversionRateConfig = scalableMatrixWithUnitPricing.conversionRateConfig + createdAt = scalableMatrixWithUnitPricing.createdAt + creditAllocation = scalableMatrixWithUnitPricing.creditAllocation + currency = scalableMatrixWithUnitPricing.currency + discount = scalableMatrixWithUnitPricing.discount + externalPriceId = scalableMatrixWithUnitPricing.externalPriceId + fixedPriceQuantity = scalableMatrixWithUnitPricing.fixedPriceQuantity + invoicingCycleConfiguration = + scalableMatrixWithUnitPricing.invoicingCycleConfiguration + item = scalableMatrixWithUnitPricing.item + maximum = scalableMatrixWithUnitPricing.maximum + maximumAmount = scalableMatrixWithUnitPricing.maximumAmount + metadata = scalableMatrixWithUnitPricing.metadata + minimum = scalableMatrixWithUnitPricing.minimum + minimumAmount = scalableMatrixWithUnitPricing.minimumAmount + modelType = scalableMatrixWithUnitPricing.modelType + name = scalableMatrixWithUnitPricing.name + planPhaseOrder = scalableMatrixWithUnitPricing.planPhaseOrder + priceType = scalableMatrixWithUnitPricing.priceType + replacesPriceId = scalableMatrixWithUnitPricing.replacesPriceId + scalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricing.scalableMatrixWithUnitPricingConfig + dimensionalPriceConfiguration = + scalableMatrixWithUnitPricing.dimensionalPriceConfiguration + additionalProperties = + scalableMatrixWithUnitPricing.additionalProperties.toMutableMap() + } fun id(id: String) = id(JsonField.of(id)) @@ -51333,21 +53483,6 @@ private constructor( */ fun item(item: JsonField) = apply { this.item = item } - fun maxGroupTieredPackageConfig( - maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig - ) = maxGroupTieredPackageConfig(JsonField.of(maxGroupTieredPackageConfig)) - - /** - * Sets [Builder.maxGroupTieredPackageConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.maxGroupTieredPackageConfig] with a well-typed - * [MaxGroupTieredPackageConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun maxGroupTieredPackageConfig( - maxGroupTieredPackageConfig: JsonField - ) = apply { this.maxGroupTieredPackageConfig = maxGroupTieredPackageConfig } - @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) @@ -51446,7 +53581,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("max_group_tiered_package") + * JsonValue.from("scalable_matrix_with_unit_pricing") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -51523,6 +53658,26 @@ private constructor( this.replacesPriceId = replacesPriceId } + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = + scalableMatrixWithUnitPricingConfig( + JsonField.of(scalableMatrixWithUnitPricingConfig) + ) + + /** + * Sets [Builder.scalableMatrixWithUnitPricingConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.scalableMatrixWithUnitPricingConfig] with a + * well-typed [ScalableMatrixWithUnitPricingConfig] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: JsonField + ) = apply { + this.scalableMatrixWithUnitPricingConfig = scalableMatrixWithUnitPricingConfig + } + fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -51566,7 +53721,7 @@ private constructor( } /** - * Returns an immutable instance of [MaxGroupTieredPackage]. + * Returns an immutable instance of [ScalableMatrixWithUnitPricing]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -51586,7 +53741,6 @@ private constructor( * .fixedPriceQuantity() * .invoicingCycleConfiguration() * .item() - * .maxGroupTieredPackageConfig() * .maximum() * .maximumAmount() * .metadata() @@ -51596,12 +53750,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() + * .scalableMatrixWithUnitPricingConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): MaxGroupTieredPackage = - MaxGroupTieredPackage( + fun build(): ScalableMatrixWithUnitPricing = + ScalableMatrixWithUnitPricing( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -51616,7 +53771,6 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("maxGroupTieredPackageConfig", maxGroupTieredPackageConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -51627,6 +53781,10 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), + checkRequired( + "scalableMatrixWithUnitPricingConfig", + scalableMatrixWithUnitPricingConfig, + ), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -51634,7 +53792,7 @@ private constructor( private var validated: Boolean = false - fun validate(): MaxGroupTieredPackage = apply { + fun validate(): ScalableMatrixWithUnitPricing = apply { if (validated) { return@apply } @@ -51653,14 +53811,13 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - maxGroupTieredPackageConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("max_group_tiered_package")) { + if (it != JsonValue.from("scalable_matrix_with_unit_pricing")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -51668,6 +53825,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() + scalableMatrixWithUnitPricingConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -51702,17 +53860,19 @@ private constructor( (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + - (maxGroupTieredPackageConfig.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + (if (maximumAmount.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("max_group_tiered_package")) 1 else 0 } + + modelType.let { + if (it == JsonValue.from("scalable_matrix_with_unit_pricing")) 1 else 0 + } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + + (scalableMatrixWithUnitPricingConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -52049,117 +54209,6 @@ private constructor( } } - class MaxGroupTieredPackageConfig - @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 - * [MaxGroupTieredPackageConfig]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [MaxGroupTieredPackageConfig]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig) = - apply { - additionalProperties = - maxGroupTieredPackageConfig.additionalProperties.toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [MaxGroupTieredPackageConfig]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): MaxGroupTieredPackageConfig = - MaxGroupTieredPackageConfig(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): MaxGroupTieredPackageConfig = 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 /* spotless:off */ other is MaxGroupTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "MaxGroupTieredPackageConfig{additionalProperties=$additionalProperties}" - } - /** * 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 @@ -52398,25 +54447,137 @@ private constructor( override fun toString() = value.toString() } + class ScalableMatrixWithUnitPricingConfig + @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 + * [ScalableMatrixWithUnitPricingConfig]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScalableMatrixWithUnitPricingConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithUnitPricingConfig.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ScalableMatrixWithUnitPricingConfig]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScalableMatrixWithUnitPricingConfig = + ScalableMatrixWithUnitPricingConfig(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): ScalableMatrixWithUnitPricingConfig = 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 /* spotless:off */ other is ScalableMatrixWithUnitPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScalableMatrixWithUnitPricingConfig{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is MaxGroupTieredPackage && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maxGroupTieredPackageConfig == other.maxGroupTieredPackageConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithUnitPricing && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maxGroupTieredPackageConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaxGroupTieredPackage{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "ScalableMatrixWithUnitPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class ScalableMatrixWithUnitPricing + class ScalableMatrixWithTieredPricing private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -52442,8 +54603,8 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val scalableMatrixWithUnitPricingConfig: - JsonField, + private val scalableMatrixWithTieredPricingConfig: + JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -52508,9 +54669,10 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("scalable_matrix_with_unit_pricing_config") + @JsonProperty("scalable_matrix_with_tiered_pricing_config") @ExcludeMissing - scalableMatrixWithUnitPricingConfig: JsonField = + scalableMatrixWithTieredPricingConfig: + JsonField = JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing @@ -52541,7 +54703,7 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - scalableMatrixWithUnitPricingConfig, + scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -52676,7 +54838,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("scalable_matrix_with_unit_pricing") + * JsonValue.from("scalable_matrix_with_tiered_pricing") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -52715,9 +54877,9 @@ private constructor( * @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 scalableMatrixWithUnitPricingConfig(): ScalableMatrixWithUnitPricingConfig = - scalableMatrixWithUnitPricingConfig.getRequired( - "scalable_matrix_with_unit_pricing_config" + fun scalableMatrixWithTieredPricingConfig(): ScalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig.getRequired( + "scalable_matrix_with_tiered_pricing_config" ) /** @@ -52942,15 +55104,15 @@ private constructor( fun _replacesPriceId(): JsonField = replacesPriceId /** - * Returns the raw JSON value of [scalableMatrixWithUnitPricingConfig]. + * Returns the raw JSON value of [scalableMatrixWithTieredPricingConfig]. * - * Unlike [scalableMatrixWithUnitPricingConfig], this method doesn't throw if the JSON field - * has an unexpected type. + * Unlike [scalableMatrixWithTieredPricingConfig], this method doesn't throw if the JSON + * field has an unexpected type. */ - @JsonProperty("scalable_matrix_with_unit_pricing_config") + @JsonProperty("scalable_matrix_with_tiered_pricing_config") @ExcludeMissing - fun _scalableMatrixWithUnitPricingConfig(): JsonField = - scalableMatrixWithUnitPricingConfig + fun _scalableMatrixWithTieredPricingConfig(): + JsonField = scalableMatrixWithTieredPricingConfig /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. @@ -52979,7 +55141,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [ScalableMatrixWithUnitPricing]. + * [ScalableMatrixWithTieredPricing]. * * The following fields are required: * ```java @@ -53006,13 +55168,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .scalableMatrixWithUnitPricingConfig() + * .scalableMatrixWithTieredPricingConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [ScalableMatrixWithUnitPricing]. */ + /** A builder for [ScalableMatrixWithTieredPricing]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -53034,53 +55196,53 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("scalable_matrix_with_unit_pricing") + private var modelType: JsonValue = JsonValue.from("scalable_matrix_with_tiered_pricing") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var scalableMatrixWithUnitPricingConfig: - JsonField? = + private var scalableMatrixWithTieredPricingConfig: + JsonField? = null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing) = + internal fun from(scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing) = apply { - id = scalableMatrixWithUnitPricing.id - billableMetric = scalableMatrixWithUnitPricing.billableMetric + id = scalableMatrixWithTieredPricing.id + billableMetric = scalableMatrixWithTieredPricing.billableMetric billingCycleConfiguration = - scalableMatrixWithUnitPricing.billingCycleConfiguration - cadence = scalableMatrixWithUnitPricing.cadence - conversionRate = scalableMatrixWithUnitPricing.conversionRate - conversionRateConfig = scalableMatrixWithUnitPricing.conversionRateConfig - createdAt = scalableMatrixWithUnitPricing.createdAt - creditAllocation = scalableMatrixWithUnitPricing.creditAllocation - currency = scalableMatrixWithUnitPricing.currency - discount = scalableMatrixWithUnitPricing.discount - externalPriceId = scalableMatrixWithUnitPricing.externalPriceId - fixedPriceQuantity = scalableMatrixWithUnitPricing.fixedPriceQuantity + scalableMatrixWithTieredPricing.billingCycleConfiguration + cadence = scalableMatrixWithTieredPricing.cadence + conversionRate = scalableMatrixWithTieredPricing.conversionRate + conversionRateConfig = scalableMatrixWithTieredPricing.conversionRateConfig + createdAt = scalableMatrixWithTieredPricing.createdAt + creditAllocation = scalableMatrixWithTieredPricing.creditAllocation + currency = scalableMatrixWithTieredPricing.currency + discount = scalableMatrixWithTieredPricing.discount + externalPriceId = scalableMatrixWithTieredPricing.externalPriceId + fixedPriceQuantity = scalableMatrixWithTieredPricing.fixedPriceQuantity invoicingCycleConfiguration = - scalableMatrixWithUnitPricing.invoicingCycleConfiguration - item = scalableMatrixWithUnitPricing.item - maximum = scalableMatrixWithUnitPricing.maximum - maximumAmount = scalableMatrixWithUnitPricing.maximumAmount - metadata = scalableMatrixWithUnitPricing.metadata - minimum = scalableMatrixWithUnitPricing.minimum - minimumAmount = scalableMatrixWithUnitPricing.minimumAmount - modelType = scalableMatrixWithUnitPricing.modelType - name = scalableMatrixWithUnitPricing.name - planPhaseOrder = scalableMatrixWithUnitPricing.planPhaseOrder - priceType = scalableMatrixWithUnitPricing.priceType - replacesPriceId = scalableMatrixWithUnitPricing.replacesPriceId - scalableMatrixWithUnitPricingConfig = - scalableMatrixWithUnitPricing.scalableMatrixWithUnitPricingConfig + scalableMatrixWithTieredPricing.invoicingCycleConfiguration + item = scalableMatrixWithTieredPricing.item + maximum = scalableMatrixWithTieredPricing.maximum + maximumAmount = scalableMatrixWithTieredPricing.maximumAmount + metadata = scalableMatrixWithTieredPricing.metadata + minimum = scalableMatrixWithTieredPricing.minimum + minimumAmount = scalableMatrixWithTieredPricing.minimumAmount + modelType = scalableMatrixWithTieredPricing.modelType + name = scalableMatrixWithTieredPricing.name + planPhaseOrder = scalableMatrixWithTieredPricing.planPhaseOrder + priceType = scalableMatrixWithTieredPricing.priceType + replacesPriceId = scalableMatrixWithTieredPricing.replacesPriceId + scalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricing.scalableMatrixWithTieredPricingConfig dimensionalPriceConfiguration = - scalableMatrixWithUnitPricing.dimensionalPriceConfiguration + scalableMatrixWithTieredPricing.dimensionalPriceConfiguration additionalProperties = - scalableMatrixWithUnitPricing.additionalProperties.toMutableMap() + scalableMatrixWithTieredPricing.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -53542,7 +55704,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("scalable_matrix_with_unit_pricing") + * JsonValue.from("scalable_matrix_with_tiered_pricing") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -53619,24 +55781,25 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun scalableMatrixWithUnitPricingConfig( - scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig ) = - scalableMatrixWithUnitPricingConfig( - JsonField.of(scalableMatrixWithUnitPricingConfig) + scalableMatrixWithTieredPricingConfig( + JsonField.of(scalableMatrixWithTieredPricingConfig) ) /** - * Sets [Builder.scalableMatrixWithUnitPricingConfig] to an arbitrary JSON value. + * Sets [Builder.scalableMatrixWithTieredPricingConfig] to an arbitrary JSON value. * - * You should usually call [Builder.scalableMatrixWithUnitPricingConfig] with a - * well-typed [ScalableMatrixWithUnitPricingConfig] value instead. This method is + * You should usually call [Builder.scalableMatrixWithTieredPricingConfig] with a + * well-typed [ScalableMatrixWithTieredPricingConfig] value instead. This method is * primarily for setting the field to an undocumented or not yet supported value. */ - fun scalableMatrixWithUnitPricingConfig( - scalableMatrixWithUnitPricingConfig: JsonField + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: + JsonField ) = apply { - this.scalableMatrixWithUnitPricingConfig = scalableMatrixWithUnitPricingConfig + this.scalableMatrixWithTieredPricingConfig = scalableMatrixWithTieredPricingConfig } fun dimensionalPriceConfiguration( @@ -53682,7 +55845,7 @@ private constructor( } /** - * Returns an immutable instance of [ScalableMatrixWithUnitPricing]. + * Returns an immutable instance of [ScalableMatrixWithTieredPricing]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -53711,13 +55874,13 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .scalableMatrixWithUnitPricingConfig() + * .scalableMatrixWithTieredPricingConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): ScalableMatrixWithUnitPricing = - ScalableMatrixWithUnitPricing( + fun build(): ScalableMatrixWithTieredPricing = + ScalableMatrixWithTieredPricing( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -53743,8 +55906,8 @@ private constructor( checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), checkRequired( - "scalableMatrixWithUnitPricingConfig", - scalableMatrixWithUnitPricingConfig, + "scalableMatrixWithTieredPricingConfig", + scalableMatrixWithTieredPricingConfig, ), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), @@ -53753,7 +55916,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ScalableMatrixWithUnitPricing = apply { + fun validate(): ScalableMatrixWithTieredPricing = apply { if (validated) { return@apply } @@ -53778,7 +55941,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("scalable_matrix_with_unit_pricing")) { + if (it != JsonValue.from("scalable_matrix_with_tiered_pricing")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -53786,7 +55949,7 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - scalableMatrixWithUnitPricingConfig().validate() + scalableMatrixWithTieredPricingConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -53827,13 +55990,13 @@ private constructor( (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + modelType.let { - if (it == JsonValue.from("scalable_matrix_with_unit_pricing")) 1 else 0 + if (it == JsonValue.from("scalable_matrix_with_tiered_pricing")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (scalableMatrixWithUnitPricingConfig.asKnown().getOrNull()?.validity() ?: 0) + + (scalableMatrixWithTieredPricingConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -54408,7 +56571,7 @@ private constructor( override fun toString() = value.toString() } - class ScalableMatrixWithUnitPricingConfig + class ScalableMatrixWithTieredPricingConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -54425,22 +56588,22 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [ScalableMatrixWithUnitPricingConfig]. + * [ScalableMatrixWithTieredPricingConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [ScalableMatrixWithUnitPricingConfig]. */ + /** A builder for [ScalableMatrixWithTieredPricingConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( - scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig ) = apply { additionalProperties = - scalableMatrixWithUnitPricingConfig.additionalProperties.toMutableMap() + scalableMatrixWithTieredPricingConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -54466,17 +56629,17 @@ private constructor( } /** - * Returns an immutable instance of [ScalableMatrixWithUnitPricingConfig]. + * Returns an immutable instance of [ScalableMatrixWithTieredPricingConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): ScalableMatrixWithUnitPricingConfig = - ScalableMatrixWithUnitPricingConfig(additionalProperties.toImmutable()) + fun build(): ScalableMatrixWithTieredPricingConfig = + ScalableMatrixWithTieredPricingConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): ScalableMatrixWithUnitPricingConfig = apply { + fun validate(): ScalableMatrixWithTieredPricingConfig = apply { if (validated) { return@apply } @@ -54507,7 +56670,7 @@ private constructor( return true } - return /* spotless:off */ other is ScalableMatrixWithUnitPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithTieredPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -54517,7 +56680,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ScalableMatrixWithUnitPricingConfig{additionalProperties=$additionalProperties}" + "ScalableMatrixWithTieredPricingConfig{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -54525,20 +56688,20 @@ private constructor( return true } - return /* spotless:off */ other is ScalableMatrixWithUnitPricing && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithTieredPricing && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ScalableMatrixWithUnitPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "ScalableMatrixWithTieredPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class ScalableMatrixWithTieredPricing + class CumulativeGroupedBulk private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -54548,6 +56711,7 @@ private constructor( private val conversionRateConfig: JsonField, private val createdAt: JsonField, private val creditAllocation: JsonField, + private val cumulativeGroupedBulkConfig: JsonField, private val currency: JsonField, private val discount: JsonField, private val externalPriceId: JsonField, @@ -54564,8 +56728,6 @@ private constructor( private val planPhaseOrder: JsonField, private val priceType: JsonField, private val replacesPriceId: JsonField, - private val scalableMatrixWithTieredPricingConfig: - JsonField, private val dimensionalPriceConfiguration: JsonField, private val additionalProperties: MutableMap, ) { @@ -54592,6 +56754,9 @@ private constructor( @JsonProperty("credit_allocation") @ExcludeMissing creditAllocation: JsonField = JsonMissing.of(), + @JsonProperty("cumulative_grouped_bulk_config") + @ExcludeMissing + cumulativeGroupedBulkConfig: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @@ -54630,11 +56795,6 @@ private constructor( @JsonProperty("replaces_price_id") @ExcludeMissing replacesPriceId: JsonField = JsonMissing.of(), - @JsonProperty("scalable_matrix_with_tiered_pricing_config") - @ExcludeMissing - scalableMatrixWithTieredPricingConfig: - JsonField = - JsonMissing.of(), @JsonProperty("dimensional_price_configuration") @ExcludeMissing dimensionalPriceConfiguration: JsonField = @@ -54648,6 +56808,7 @@ private constructor( conversionRateConfig, createdAt, creditAllocation, + cumulativeGroupedBulkConfig, currency, discount, externalPriceId, @@ -54664,7 +56825,6 @@ private constructor( planPhaseOrder, priceType, replacesPriceId, - scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, mutableMapOf(), ) @@ -54721,6 +56881,13 @@ private constructor( fun creditAllocation(): Optional = creditAllocation.getOptional("credit_allocation") + /** + * @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 cumulativeGroupedBulkConfig(): CumulativeGroupedBulkConfig = + cumulativeGroupedBulkConfig.getRequired("cumulative_grouped_bulk_config") + /** * @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). @@ -54799,7 +56966,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("scalable_matrix_with_tiered_pricing") + * JsonValue.from("cumulative_grouped_bulk") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -54834,15 +57001,6 @@ private constructor( */ fun replacesPriceId(): Optional = replacesPriceId.getOptional("replaces_price_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 scalableMatrixWithTieredPricingConfig(): ScalableMatrixWithTieredPricingConfig = - scalableMatrixWithTieredPricingConfig.getRequired( - "scalable_matrix_with_tiered_pricing_config" - ) - /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -54924,6 +57082,17 @@ private constructor( @ExcludeMissing fun _creditAllocation(): JsonField = creditAllocation + /** + * Returns the raw JSON value of [cumulativeGroupedBulkConfig]. + * + * Unlike [cumulativeGroupedBulkConfig], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("cumulative_grouped_bulk_config") + @ExcludeMissing + fun _cumulativeGroupedBulkConfig(): JsonField = + cumulativeGroupedBulkConfig + /** * Returns the raw JSON value of [currency]. * @@ -55064,17 +57233,6 @@ private constructor( @ExcludeMissing fun _replacesPriceId(): JsonField = replacesPriceId - /** - * Returns the raw JSON value of [scalableMatrixWithTieredPricingConfig]. - * - * Unlike [scalableMatrixWithTieredPricingConfig], this method doesn't throw if the JSON - * field has an unexpected type. - */ - @JsonProperty("scalable_matrix_with_tiered_pricing_config") - @ExcludeMissing - fun _scalableMatrixWithTieredPricingConfig(): - JsonField = scalableMatrixWithTieredPricingConfig - /** * Returns the raw JSON value of [dimensionalPriceConfiguration]. * @@ -55101,8 +57259,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [ScalableMatrixWithTieredPricing]. + * Returns a mutable builder for constructing an instance of [CumulativeGroupedBulk]. * * The following fields are required: * ```java @@ -55114,6 +57271,7 @@ private constructor( * .conversionRateConfig() * .createdAt() * .creditAllocation() + * .cumulativeGroupedBulkConfig() * .currency() * .discount() * .externalPriceId() @@ -55129,13 +57287,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .scalableMatrixWithTieredPricingConfig() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [ScalableMatrixWithTieredPricing]. */ + /** A builder for [CumulativeGroupedBulk]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -55146,6 +57303,7 @@ private constructor( private var conversionRateConfig: JsonField? = null private var createdAt: JsonField? = null private var creditAllocation: JsonField? = null + private var cumulativeGroupedBulkConfig: JsonField? = null private var currency: JsonField? = null private var discount: JsonField? = null private var externalPriceId: JsonField? = null @@ -55157,54 +57315,45 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("scalable_matrix_with_tiered_pricing") + private var modelType: JsonValue = JsonValue.from("cumulative_grouped_bulk") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var replacesPriceId: JsonField? = null - private var scalableMatrixWithTieredPricingConfig: - JsonField? = - null private var dimensionalPriceConfiguration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing) = - apply { - id = scalableMatrixWithTieredPricing.id - billableMetric = scalableMatrixWithTieredPricing.billableMetric - billingCycleConfiguration = - scalableMatrixWithTieredPricing.billingCycleConfiguration - cadence = scalableMatrixWithTieredPricing.cadence - conversionRate = scalableMatrixWithTieredPricing.conversionRate - conversionRateConfig = scalableMatrixWithTieredPricing.conversionRateConfig - createdAt = scalableMatrixWithTieredPricing.createdAt - creditAllocation = scalableMatrixWithTieredPricing.creditAllocation - currency = scalableMatrixWithTieredPricing.currency - discount = scalableMatrixWithTieredPricing.discount - externalPriceId = scalableMatrixWithTieredPricing.externalPriceId - fixedPriceQuantity = scalableMatrixWithTieredPricing.fixedPriceQuantity - invoicingCycleConfiguration = - scalableMatrixWithTieredPricing.invoicingCycleConfiguration - item = scalableMatrixWithTieredPricing.item - maximum = scalableMatrixWithTieredPricing.maximum - maximumAmount = scalableMatrixWithTieredPricing.maximumAmount - metadata = scalableMatrixWithTieredPricing.metadata - minimum = scalableMatrixWithTieredPricing.minimum - minimumAmount = scalableMatrixWithTieredPricing.minimumAmount - modelType = scalableMatrixWithTieredPricing.modelType - name = scalableMatrixWithTieredPricing.name - planPhaseOrder = scalableMatrixWithTieredPricing.planPhaseOrder - priceType = scalableMatrixWithTieredPricing.priceType - replacesPriceId = scalableMatrixWithTieredPricing.replacesPriceId - scalableMatrixWithTieredPricingConfig = - scalableMatrixWithTieredPricing.scalableMatrixWithTieredPricingConfig - dimensionalPriceConfiguration = - scalableMatrixWithTieredPricing.dimensionalPriceConfiguration - additionalProperties = - scalableMatrixWithTieredPricing.additionalProperties.toMutableMap() - } + internal fun from(cumulativeGroupedBulk: CumulativeGroupedBulk) = apply { + id = cumulativeGroupedBulk.id + billableMetric = cumulativeGroupedBulk.billableMetric + billingCycleConfiguration = cumulativeGroupedBulk.billingCycleConfiguration + cadence = cumulativeGroupedBulk.cadence + conversionRate = cumulativeGroupedBulk.conversionRate + conversionRateConfig = cumulativeGroupedBulk.conversionRateConfig + createdAt = cumulativeGroupedBulk.createdAt + creditAllocation = cumulativeGroupedBulk.creditAllocation + cumulativeGroupedBulkConfig = cumulativeGroupedBulk.cumulativeGroupedBulkConfig + currency = cumulativeGroupedBulk.currency + discount = cumulativeGroupedBulk.discount + externalPriceId = cumulativeGroupedBulk.externalPriceId + fixedPriceQuantity = cumulativeGroupedBulk.fixedPriceQuantity + invoicingCycleConfiguration = cumulativeGroupedBulk.invoicingCycleConfiguration + item = cumulativeGroupedBulk.item + maximum = cumulativeGroupedBulk.maximum + maximumAmount = cumulativeGroupedBulk.maximumAmount + metadata = cumulativeGroupedBulk.metadata + minimum = cumulativeGroupedBulk.minimum + minimumAmount = cumulativeGroupedBulk.minimumAmount + modelType = cumulativeGroupedBulk.modelType + name = cumulativeGroupedBulk.name + planPhaseOrder = cumulativeGroupedBulk.planPhaseOrder + priceType = cumulativeGroupedBulk.priceType + replacesPriceId = cumulativeGroupedBulk.replacesPriceId + dimensionalPriceConfiguration = cumulativeGroupedBulk.dimensionalPriceConfiguration + additionalProperties = cumulativeGroupedBulk.additionalProperties.toMutableMap() + } fun id(id: String) = id(JsonField.of(id)) @@ -55387,6 +57536,21 @@ private constructor( this.creditAllocation = creditAllocation } + fun cumulativeGroupedBulkConfig( + cumulativeGroupedBulkConfig: CumulativeGroupedBulkConfig + ) = cumulativeGroupedBulkConfig(JsonField.of(cumulativeGroupedBulkConfig)) + + /** + * Sets [Builder.cumulativeGroupedBulkConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.cumulativeGroupedBulkConfig] with a well-typed + * [CumulativeGroupedBulkConfig] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun cumulativeGroupedBulkConfig( + cumulativeGroupedBulkConfig: JsonField + ) = apply { this.cumulativeGroupedBulkConfig = cumulativeGroupedBulkConfig } + fun currency(currency: String) = currency(JsonField.of(currency)) /** @@ -55665,7 +57829,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("scalable_matrix_with_tiered_pricing") + * JsonValue.from("cumulative_grouped_bulk") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -55742,27 +57906,6 @@ private constructor( this.replacesPriceId = replacesPriceId } - fun scalableMatrixWithTieredPricingConfig( - scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig - ) = - scalableMatrixWithTieredPricingConfig( - JsonField.of(scalableMatrixWithTieredPricingConfig) - ) - - /** - * Sets [Builder.scalableMatrixWithTieredPricingConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.scalableMatrixWithTieredPricingConfig] with a - * well-typed [ScalableMatrixWithTieredPricingConfig] value instead. This method is - * primarily for setting the field to an undocumented or not yet supported value. - */ - fun scalableMatrixWithTieredPricingConfig( - scalableMatrixWithTieredPricingConfig: - JsonField - ) = apply { - this.scalableMatrixWithTieredPricingConfig = scalableMatrixWithTieredPricingConfig - } - fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: DimensionalPriceConfiguration? ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) @@ -55806,7 +57949,7 @@ private constructor( } /** - * Returns an immutable instance of [ScalableMatrixWithTieredPricing]. + * Returns an immutable instance of [CumulativeGroupedBulk]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -55820,6 +57963,7 @@ private constructor( * .conversionRateConfig() * .createdAt() * .creditAllocation() + * .cumulativeGroupedBulkConfig() * .currency() * .discount() * .externalPriceId() @@ -55835,13 +57979,12 @@ private constructor( * .planPhaseOrder() * .priceType() * .replacesPriceId() - * .scalableMatrixWithTieredPricingConfig() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): ScalableMatrixWithTieredPricing = - ScalableMatrixWithTieredPricing( + fun build(): CumulativeGroupedBulk = + CumulativeGroupedBulk( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -55850,6 +57993,7 @@ private constructor( checkRequired("conversionRateConfig", conversionRateConfig), checkRequired("createdAt", createdAt), checkRequired("creditAllocation", creditAllocation), + checkRequired("cumulativeGroupedBulkConfig", cumulativeGroupedBulkConfig), checkRequired("currency", currency), checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), @@ -55866,10 +58010,6 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("replacesPriceId", replacesPriceId), - checkRequired( - "scalableMatrixWithTieredPricingConfig", - scalableMatrixWithTieredPricingConfig, - ), dimensionalPriceConfiguration, additionalProperties.toMutableMap(), ) @@ -55877,7 +58017,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ScalableMatrixWithTieredPricing = apply { + fun validate(): CumulativeGroupedBulk = apply { if (validated) { return@apply } @@ -55890,6 +58030,7 @@ private constructor( conversionRateConfig().ifPresent { it.validate() } createdAt() creditAllocation().ifPresent { it.validate() } + cumulativeGroupedBulkConfig().validate() currency() discount().ifPresent { it.validate() } externalPriceId() @@ -55902,7 +58043,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("scalable_matrix_with_tiered_pricing")) { + if (it != JsonValue.from("cumulative_grouped_bulk")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -55910,7 +58051,6 @@ private constructor( planPhaseOrder() priceType().validate() replacesPriceId() - scalableMatrixWithTieredPricingConfig().validate() dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -55939,6 +58079,7 @@ private constructor( (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (creditAllocation.asKnown().getOrNull()?.validity() ?: 0) + + (cumulativeGroupedBulkConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (currency.asKnown().isPresent) 1 else 0) + (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + @@ -55950,14 +58091,11 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { - if (it == JsonValue.from("scalable_matrix_with_tiered_pricing")) 1 else 0 - } + + modelType.let { if (it == JsonValue.from("cumulative_grouped_bulk")) 1 else 0 } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + (if (replacesPriceId.asKnown().isPresent) 1 else 0) + - (scalableMatrixWithTieredPricingConfig.asKnown().getOrNull()?.validity() ?: 0) + (dimensionalPriceConfiguration.asKnown().getOrNull()?.validity() ?: 0) class Cadence @JsonCreator private constructor(private val value: JsonField) : @@ -56294,12 +58432,7 @@ private constructor( } } - /** - * 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 + class CumulativeGroupedBulkConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -56314,19 +58447,24 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [Metadata]. */ + /** + * Returns a mutable builder for constructing an instance of + * [CumulativeGroupedBulkConfig]. + */ @JvmStatic fun builder() = Builder() } - /** A builder for [Metadata]. */ + /** A builder for [CumulativeGroupedBulkConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(metadata: Metadata) = apply { - additionalProperties = metadata.additionalProperties.toMutableMap() - } + internal fun from(cumulativeGroupedBulkConfig: CumulativeGroupedBulkConfig) = + apply { + additionalProperties = + cumulativeGroupedBulkConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -56351,16 +58489,17 @@ private constructor( } /** - * Returns an immutable instance of [Metadata]. + * Returns an immutable instance of [CumulativeGroupedBulkConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + fun build(): CumulativeGroupedBulkConfig = + CumulativeGroupedBulkConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): Metadata = apply { + fun validate(): CumulativeGroupedBulkConfig = apply { if (validated) { return@apply } @@ -56391,7 +58530,7 @@ private constructor( return true } - return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CumulativeGroupedBulkConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -56400,139 +58539,16 @@ private constructor( 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") - - @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) - } - - /** An enum containing [PriceType]'s known values. */ - enum class Known { - USAGE_PRICE, - FIXED_PRICE, - } - - /** - * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [PriceType] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - USAGE_PRICE, - FIXED_PRICE, - /** - * An enum member indicating that [PriceType] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - USAGE_PRICE -> Value.USAGE_PRICE - FIXED_PRICE -> Value.FIXED_PRICE - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws OrbInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - USAGE_PRICE -> Known.USAGE_PRICE - FIXED_PRICE -> Known.FIXED_PRICE - else -> throw OrbInvalidDataException("Unknown PriceType: $value") - } - - /** - * 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 /* spotless:off */ other is PriceType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + override fun toString() = + "CumulativeGroupedBulkConfig{additionalProperties=$additionalProperties}" } - class ScalableMatrixWithTieredPricingConfig + /** + * 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 @@ -56547,24 +58563,18 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of - * [ScalableMatrixWithTieredPricingConfig]. - */ + /** Returns a mutable builder for constructing an instance of [Metadata]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [ScalableMatrixWithTieredPricingConfig]. */ + /** A builder for [Metadata]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig - ) = apply { - additionalProperties = - scalableMatrixWithTieredPricingConfig.additionalProperties.toMutableMap() + internal fun from(metadata: Metadata) = apply { + additionalProperties = metadata.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -56590,17 +58600,16 @@ private constructor( } /** - * Returns an immutable instance of [ScalableMatrixWithTieredPricingConfig]. + * Returns an immutable instance of [Metadata]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): ScalableMatrixWithTieredPricingConfig = - ScalableMatrixWithTieredPricingConfig(additionalProperties.toImmutable()) + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): ScalableMatrixWithTieredPricingConfig = apply { + fun validate(): Metadata = apply { if (validated) { return@apply } @@ -56631,7 +58640,7 @@ private constructor( return true } - return /* spotless:off */ other is ScalableMatrixWithTieredPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -56640,8 +58649,136 @@ private constructor( override fun hashCode(): Int = hashCode - override fun toString() = - "ScalableMatrixWithTieredPricingConfig{additionalProperties=$additionalProperties}" + 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") + + @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + } + + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_PRICE, + FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_PRICE -> Value.USAGE_PRICE + FIXED_PRICE -> Value.FIXED_PRICE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + USAGE_PRICE -> Known.USAGE_PRICE + FIXED_PRICE -> Known.FIXED_PRICE + else -> throw OrbInvalidDataException("Unknown PriceType: $value") + } + + /** + * 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 /* spotless:off */ other is PriceType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -56649,20 +58786,20 @@ private constructor( return true } - return /* spotless:off */ other is ScalableMatrixWithTieredPricing && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CumulativeGroupedBulk && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && cumulativeGroupedBulkConfig == other.cumulativeGroupedBulkConfig && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, cumulativeGroupedBulkConfig, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ScalableMatrixWithTieredPricing{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "CumulativeGroupedBulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } - class CumulativeGroupedBulk + class GroupedWithMinMaxThresholds private constructor( private val id: JsonField, private val billableMetric: JsonField, @@ -56672,11 +58809,11 @@ private constructor( private val conversionRateConfig: JsonField, private val createdAt: JsonField, private val creditAllocation: JsonField, - private val cumulativeGroupedBulkConfig: JsonField, private val currency: JsonField, private val discount: JsonField, private val externalPriceId: JsonField, private val fixedPriceQuantity: JsonField, + private val groupedWithMinMaxThresholdsConfig: JsonField, private val invoicingCycleConfiguration: JsonField, private val item: JsonField, private val maximum: JsonField, @@ -56715,9 +58852,6 @@ private constructor( @JsonProperty("credit_allocation") @ExcludeMissing creditAllocation: JsonField = JsonMissing.of(), - @JsonProperty("cumulative_grouped_bulk_config") - @ExcludeMissing - cumulativeGroupedBulkConfig: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @@ -56730,6 +58864,10 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("grouped_with_min_max_thresholds_config") + @ExcludeMissing + groupedWithMinMaxThresholdsConfig: JsonField = + JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing invoicingCycleConfiguration: JsonField = JsonMissing.of(), @@ -56769,11 +58907,11 @@ private constructor( conversionRateConfig, createdAt, creditAllocation, - cumulativeGroupedBulkConfig, currency, discount, externalPriceId, fixedPriceQuantity, + groupedWithMinMaxThresholdsConfig, invoicingCycleConfiguration, item, maximum, @@ -56842,13 +58980,6 @@ private constructor( fun creditAllocation(): Optional = creditAllocation.getOptional("credit_allocation") - /** - * @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 cumulativeGroupedBulkConfig(): CumulativeGroupedBulkConfig = - cumulativeGroupedBulkConfig.getRequired("cumulative_grouped_bulk_config") - /** * @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). @@ -56875,6 +59006,13 @@ private constructor( fun fixedPriceQuantity(): Optional = fixedPriceQuantity.getOptional("fixed_price_quantity") + /** + * @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 groupedWithMinMaxThresholdsConfig(): GroupedWithMinMaxThresholdsConfig = + groupedWithMinMaxThresholdsConfig.getRequired("grouped_with_min_max_thresholds_config") + /** * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -56927,7 +59065,7 @@ private constructor( /** * Expected to always return the following: * ```java - * JsonValue.from("cumulative_grouped_bulk") + * JsonValue.from("grouped_with_min_max_thresholds") * ``` * * However, this method can be useful for debugging and logging (e.g. if the server @@ -57043,17 +59181,6 @@ private constructor( @ExcludeMissing fun _creditAllocation(): JsonField = creditAllocation - /** - * Returns the raw JSON value of [cumulativeGroupedBulkConfig]. - * - * Unlike [cumulativeGroupedBulkConfig], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("cumulative_grouped_bulk_config") - @ExcludeMissing - fun _cumulativeGroupedBulkConfig(): JsonField = - cumulativeGroupedBulkConfig - /** * Returns the raw JSON value of [currency]. * @@ -57091,6 +59218,17 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + /** + * Returns the raw JSON value of [groupedWithMinMaxThresholdsConfig]. + * + * Unlike [groupedWithMinMaxThresholdsConfig], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("grouped_with_min_max_thresholds_config") + @ExcludeMissing + fun _groupedWithMinMaxThresholdsConfig(): JsonField = + groupedWithMinMaxThresholdsConfig + /** * Returns the raw JSON value of [invoicingCycleConfiguration]. * @@ -57220,7 +59358,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CumulativeGroupedBulk]. + * Returns a mutable builder for constructing an instance of + * [GroupedWithMinMaxThresholds]. * * The following fields are required: * ```java @@ -57232,11 +59371,11 @@ private constructor( * .conversionRateConfig() * .createdAt() * .creditAllocation() - * .cumulativeGroupedBulkConfig() * .currency() * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedWithMinMaxThresholdsConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -57253,7 +59392,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CumulativeGroupedBulk]. */ + /** A builder for [GroupedWithMinMaxThresholds]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -57264,11 +59403,13 @@ private constructor( private var conversionRateConfig: JsonField? = null private var createdAt: JsonField? = null private var creditAllocation: JsonField? = null - private var cumulativeGroupedBulkConfig: JsonField? = null private var currency: JsonField? = null private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null + private var groupedWithMinMaxThresholdsConfig: + JsonField? = + null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -57276,7 +59417,7 @@ private constructor( private var metadata: JsonField? = null private var minimum: JsonField? = null private var minimumAmount: JsonField? = null - private var modelType: JsonValue = JsonValue.from("cumulative_grouped_bulk") + private var modelType: JsonValue = JsonValue.from("grouped_with_min_max_thresholds") private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null @@ -57286,34 +59427,38 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cumulativeGroupedBulk: CumulativeGroupedBulk) = apply { - id = cumulativeGroupedBulk.id - billableMetric = cumulativeGroupedBulk.billableMetric - billingCycleConfiguration = cumulativeGroupedBulk.billingCycleConfiguration - cadence = cumulativeGroupedBulk.cadence - conversionRate = cumulativeGroupedBulk.conversionRate - conversionRateConfig = cumulativeGroupedBulk.conversionRateConfig - createdAt = cumulativeGroupedBulk.createdAt - creditAllocation = cumulativeGroupedBulk.creditAllocation - cumulativeGroupedBulkConfig = cumulativeGroupedBulk.cumulativeGroupedBulkConfig - currency = cumulativeGroupedBulk.currency - discount = cumulativeGroupedBulk.discount - externalPriceId = cumulativeGroupedBulk.externalPriceId - fixedPriceQuantity = cumulativeGroupedBulk.fixedPriceQuantity - invoicingCycleConfiguration = cumulativeGroupedBulk.invoicingCycleConfiguration - item = cumulativeGroupedBulk.item - maximum = cumulativeGroupedBulk.maximum - maximumAmount = cumulativeGroupedBulk.maximumAmount - metadata = cumulativeGroupedBulk.metadata - minimum = cumulativeGroupedBulk.minimum - minimumAmount = cumulativeGroupedBulk.minimumAmount - modelType = cumulativeGroupedBulk.modelType - name = cumulativeGroupedBulk.name - planPhaseOrder = cumulativeGroupedBulk.planPhaseOrder - priceType = cumulativeGroupedBulk.priceType - replacesPriceId = cumulativeGroupedBulk.replacesPriceId - dimensionalPriceConfiguration = cumulativeGroupedBulk.dimensionalPriceConfiguration - additionalProperties = cumulativeGroupedBulk.additionalProperties.toMutableMap() + internal fun from(groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds) = apply { + id = groupedWithMinMaxThresholds.id + billableMetric = groupedWithMinMaxThresholds.billableMetric + billingCycleConfiguration = groupedWithMinMaxThresholds.billingCycleConfiguration + cadence = groupedWithMinMaxThresholds.cadence + conversionRate = groupedWithMinMaxThresholds.conversionRate + conversionRateConfig = groupedWithMinMaxThresholds.conversionRateConfig + createdAt = groupedWithMinMaxThresholds.createdAt + creditAllocation = groupedWithMinMaxThresholds.creditAllocation + currency = groupedWithMinMaxThresholds.currency + discount = groupedWithMinMaxThresholds.discount + externalPriceId = groupedWithMinMaxThresholds.externalPriceId + fixedPriceQuantity = groupedWithMinMaxThresholds.fixedPriceQuantity + groupedWithMinMaxThresholdsConfig = + groupedWithMinMaxThresholds.groupedWithMinMaxThresholdsConfig + invoicingCycleConfiguration = + groupedWithMinMaxThresholds.invoicingCycleConfiguration + item = groupedWithMinMaxThresholds.item + maximum = groupedWithMinMaxThresholds.maximum + maximumAmount = groupedWithMinMaxThresholds.maximumAmount + metadata = groupedWithMinMaxThresholds.metadata + minimum = groupedWithMinMaxThresholds.minimum + minimumAmount = groupedWithMinMaxThresholds.minimumAmount + modelType = groupedWithMinMaxThresholds.modelType + name = groupedWithMinMaxThresholds.name + planPhaseOrder = groupedWithMinMaxThresholds.planPhaseOrder + priceType = groupedWithMinMaxThresholds.priceType + replacesPriceId = groupedWithMinMaxThresholds.replacesPriceId + dimensionalPriceConfiguration = + groupedWithMinMaxThresholds.dimensionalPriceConfiguration + additionalProperties = + groupedWithMinMaxThresholds.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -57497,21 +59642,6 @@ private constructor( this.creditAllocation = creditAllocation } - fun cumulativeGroupedBulkConfig( - cumulativeGroupedBulkConfig: CumulativeGroupedBulkConfig - ) = cumulativeGroupedBulkConfig(JsonField.of(cumulativeGroupedBulkConfig)) - - /** - * Sets [Builder.cumulativeGroupedBulkConfig] to an arbitrary JSON value. - * - * You should usually call [Builder.cumulativeGroupedBulkConfig] with a well-typed - * [CumulativeGroupedBulkConfig] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun cumulativeGroupedBulkConfig( - cumulativeGroupedBulkConfig: JsonField - ) = apply { this.cumulativeGroupedBulkConfig = cumulativeGroupedBulkConfig } - fun currency(currency: String) = currency(JsonField.of(currency)) /** @@ -57658,6 +59788,21 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } + fun groupedWithMinMaxThresholdsConfig( + groupedWithMinMaxThresholdsConfig: GroupedWithMinMaxThresholdsConfig + ) = groupedWithMinMaxThresholdsConfig(JsonField.of(groupedWithMinMaxThresholdsConfig)) + + /** + * Sets [Builder.groupedWithMinMaxThresholdsConfig] to an arbitrary JSON value. + * + * You should usually call [Builder.groupedWithMinMaxThresholdsConfig] with a well-typed + * [GroupedWithMinMaxThresholdsConfig] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun groupedWithMinMaxThresholdsConfig( + groupedWithMinMaxThresholdsConfig: JsonField + ) = apply { this.groupedWithMinMaxThresholdsConfig = groupedWithMinMaxThresholdsConfig } + fun invoicingCycleConfiguration( invoicingCycleConfiguration: BillingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -57790,7 +59935,7 @@ private constructor( * It is usually unnecessary to call this method because the field defaults to the * following: * ```java - * JsonValue.from("cumulative_grouped_bulk") + * JsonValue.from("grouped_with_min_max_thresholds") * ``` * * This method is primarily for setting the field to an undocumented or not yet @@ -57910,7 +60055,7 @@ private constructor( } /** - * Returns an immutable instance of [CumulativeGroupedBulk]. + * Returns an immutable instance of [GroupedWithMinMaxThresholds]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -57924,11 +60069,11 @@ private constructor( * .conversionRateConfig() * .createdAt() * .creditAllocation() - * .cumulativeGroupedBulkConfig() * .currency() * .discount() * .externalPriceId() * .fixedPriceQuantity() + * .groupedWithMinMaxThresholdsConfig() * .invoicingCycleConfiguration() * .item() * .maximum() @@ -57944,8 +60089,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CumulativeGroupedBulk = - CumulativeGroupedBulk( + fun build(): GroupedWithMinMaxThresholds = + GroupedWithMinMaxThresholds( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -57954,11 +60099,14 @@ private constructor( checkRequired("conversionRateConfig", conversionRateConfig), checkRequired("createdAt", createdAt), checkRequired("creditAllocation", creditAllocation), - checkRequired("cumulativeGroupedBulkConfig", cumulativeGroupedBulkConfig), checkRequired("currency", currency), checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired( + "groupedWithMinMaxThresholdsConfig", + groupedWithMinMaxThresholdsConfig, + ), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -57978,7 +60126,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CumulativeGroupedBulk = apply { + fun validate(): GroupedWithMinMaxThresholds = apply { if (validated) { return@apply } @@ -57991,11 +60139,11 @@ private constructor( conversionRateConfig().ifPresent { it.validate() } createdAt() creditAllocation().ifPresent { it.validate() } - cumulativeGroupedBulkConfig().validate() currency() discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() + groupedWithMinMaxThresholdsConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -58004,7 +60152,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() _modelType().let { - if (it != JsonValue.from("cumulative_grouped_bulk")) { + if (it != JsonValue.from("grouped_with_min_max_thresholds")) { throw OrbInvalidDataException("'modelType' is invalid, received $it") } } @@ -58040,11 +60188,11 @@ private constructor( (conversionRateConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (creditAllocation.asKnown().getOrNull()?.validity() ?: 0) + - (cumulativeGroupedBulkConfig.asKnown().getOrNull()?.validity() ?: 0) + (if (currency.asKnown().isPresent) 1 else 0) + (discount.asKnown().getOrNull()?.validity() ?: 0) + (if (externalPriceId.asKnown().isPresent) 1 else 0) + (if (fixedPriceQuantity.asKnown().isPresent) 1 else 0) + + (groupedWithMinMaxThresholdsConfig.asKnown().getOrNull()?.validity() ?: 0) + (invoicingCycleConfiguration.asKnown().getOrNull()?.validity() ?: 0) + (item.asKnown().getOrNull()?.validity() ?: 0) + (maximum.asKnown().getOrNull()?.validity() ?: 0) + @@ -58052,7 +60200,9 @@ private constructor( (metadata.asKnown().getOrNull()?.validity() ?: 0) + (minimum.asKnown().getOrNull()?.validity() ?: 0) + (if (minimumAmount.asKnown().isPresent) 1 else 0) + - modelType.let { if (it == JsonValue.from("cumulative_grouped_bulk")) 1 else 0 } + + modelType.let { + if (it == JsonValue.from("grouped_with_min_max_thresholds")) 1 else 0 + } + (if (name.asKnown().isPresent) 1 else 0) + (if (planPhaseOrder.asKnown().isPresent) 1 else 0) + (priceType.asKnown().getOrNull()?.validity() ?: 0) + @@ -58249,7 +60399,7 @@ private constructor( } accept( - object : Visitor { + object : Visitor { override fun visitUnit(unit: UnitConversionRateConfig) { unit.validate() } @@ -58393,7 +60543,7 @@ private constructor( } } - class CumulativeGroupedBulkConfig + class GroupedWithMinMaxThresholdsConfig @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -58410,22 +60560,23 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [CumulativeGroupedBulkConfig]. + * [GroupedWithMinMaxThresholdsConfig]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [CumulativeGroupedBulkConfig]. */ + /** A builder for [GroupedWithMinMaxThresholdsConfig]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cumulativeGroupedBulkConfig: CumulativeGroupedBulkConfig) = - apply { - additionalProperties = - cumulativeGroupedBulkConfig.additionalProperties.toMutableMap() - } + internal fun from( + groupedWithMinMaxThresholdsConfig: GroupedWithMinMaxThresholdsConfig + ) = apply { + additionalProperties = + groupedWithMinMaxThresholdsConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -58450,17 +60601,17 @@ private constructor( } /** - * Returns an immutable instance of [CumulativeGroupedBulkConfig]. + * Returns an immutable instance of [GroupedWithMinMaxThresholdsConfig]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): CumulativeGroupedBulkConfig = - CumulativeGroupedBulkConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithMinMaxThresholdsConfig = + GroupedWithMinMaxThresholdsConfig(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): CumulativeGroupedBulkConfig = apply { + fun validate(): GroupedWithMinMaxThresholdsConfig = apply { if (validated) { return@apply } @@ -58491,7 +60642,7 @@ private constructor( return true } - return /* spotless:off */ other is CumulativeGroupedBulkConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMinMaxThresholdsConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -58501,7 +60652,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedBulkConfig{additionalProperties=$additionalProperties}" + "GroupedWithMinMaxThresholdsConfig{additionalProperties=$additionalProperties}" } /** @@ -58747,16 +60898,16 @@ private constructor( return true } - return /* spotless:off */ other is CumulativeGroupedBulk && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && cumulativeGroupedBulkConfig == other.cumulativeGroupedBulkConfig && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMinMaxThresholds && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && conversionRateConfig == other.conversionRateConfig && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && groupedWithMinMaxThresholdsConfig == other.groupedWithMinMaxThresholdsConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && replacesPriceId == other.replacesPriceId && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, cumulativeGroupedBulkConfig, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, conversionRateConfig, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithMinMaxThresholdsConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, replacesPriceId, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CumulativeGroupedBulk{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" + "GroupedWithMinMaxThresholds{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, 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}" } } 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 d9881930..a37243be 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 @@ -631,6 +631,13 @@ private constructor( fun price(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = price(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [price] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun price(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + price(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + /** * The start date of the price interval. This is the date that Orb starts billing for this * price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageResponse.kt index 71723f6c..589da067 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageResponse.kt @@ -261,6 +261,13 @@ private constructor( fun addData(cumulativeGroupedBulk: Price.CumulativeGroupedBulk) = addData(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk)) + /** + * Alias for calling [addData] with + * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`. + */ + fun addData(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) = + addData(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)) + fun paginationMetadata(paginationMetadata: PaginationMetadata) = paginationMetadata(JsonField.of(paginationMetadata)) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsync.kt index 1c2e4b22..ae24feff 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsync.kt @@ -10,6 +10,7 @@ import com.withorb.api.models.DimensionalPriceGroupCreateParams import com.withorb.api.models.DimensionalPriceGroupListPageAsync import com.withorb.api.models.DimensionalPriceGroupListParams import com.withorb.api.models.DimensionalPriceGroupRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupUpdateParams import com.withorb.api.services.async.dimensionalPriceGroups.ExternalDimensionalPriceGroupIdServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -93,6 +94,50 @@ interface DimensionalPriceGroupServiceAsync { requestOptions, ) + /** + * This endpoint can be used to update the `external_dimensional_price_group_id` and `metadata` + * of an existing dimensional price group. Other fields on a dimensional price group are + * currently immutable. + */ + fun update(dimensionalPriceGroupId: String): CompletableFuture = + update(dimensionalPriceGroupId, DimensionalPriceGroupUpdateParams.none()) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + update( + params.toBuilder().dimensionalPriceGroupId(dimensionalPriceGroupId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + ): CompletableFuture = + update(dimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see update */ + fun update( + params: DimensionalPriceGroupUpdateParams + ): CompletableFuture = update(params, RequestOptions.none()) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + update(dimensionalPriceGroupId, DimensionalPriceGroupUpdateParams.none(), requestOptions) + /** List dimensional price groups */ fun list(): CompletableFuture = list(DimensionalPriceGroupListParams.none()) @@ -199,6 +244,57 @@ interface DimensionalPriceGroupServiceAsync { requestOptions, ) + /** + * Returns a raw HTTP response for `put + * /dimensional_price_groups/{dimensional_price_group_id}`, but is otherwise the same as + * [DimensionalPriceGroupServiceAsync.update]. + */ + fun update( + dimensionalPriceGroupId: String + ): CompletableFuture> = + update(dimensionalPriceGroupId, DimensionalPriceGroupUpdateParams.none()) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + update( + params.toBuilder().dimensionalPriceGroupId(dimensionalPriceGroupId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + ): CompletableFuture> = + update(dimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see update */ + fun update( + params: DimensionalPriceGroupUpdateParams + ): CompletableFuture> = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + update( + dimensionalPriceGroupId, + DimensionalPriceGroupUpdateParams.none(), + requestOptions, + ) + /** * Returns a raw HTTP response for `get /dimensional_price_groups`, but is otherwise the * same as [DimensionalPriceGroupServiceAsync.list]. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt index 3566c647..31395c92 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt @@ -21,6 +21,7 @@ import com.withorb.api.models.DimensionalPriceGroupCreateParams import com.withorb.api.models.DimensionalPriceGroupListPageAsync import com.withorb.api.models.DimensionalPriceGroupListParams import com.withorb.api.models.DimensionalPriceGroupRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupUpdateParams import com.withorb.api.models.DimensionalPriceGroups import com.withorb.api.services.async.dimensionalPriceGroups.ExternalDimensionalPriceGroupIdServiceAsync import com.withorb.api.services.async.dimensionalPriceGroups.ExternalDimensionalPriceGroupIdServiceAsyncImpl @@ -67,6 +68,13 @@ internal constructor(private val clientOptions: ClientOptions) : DimensionalPric // get /dimensional_price_groups/{dimensional_price_group_id} withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + override fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // put /dimensional_price_groups/{dimensional_price_group_id} + withRawResponse().update(params, requestOptions).thenApply { it.parse() } + override fun list( params: DimensionalPriceGroupListParams, requestOptions: RequestOptions, @@ -160,6 +168,40 @@ internal constructor(private val clientOptions: ClientOptions) : DimensionalPric } } + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("dimensionalPriceGroupId", params.dimensionalPriceGroupId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PUT) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("dimensional_price_groups", params._pathParam(0)) + .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 { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsync.kt index eac0b24a..1f494762 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsync.kt @@ -7,6 +7,7 @@ import com.withorb.api.core.RequestOptions import com.withorb.api.core.http.HttpResponseFor import com.withorb.api.models.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -80,6 +81,64 @@ interface ExternalDimensionalPriceGroupIdServiceAsync { requestOptions, ) + /** + * This endpoint can be used to update the `external_dimensional_price_group_id` and `metadata` + * of an existing dimensional price group. Other fields on a dimensional price group are + * currently immutable. + */ + fun update( + pathExternalDimensionalPriceGroupId: String + ): CompletableFuture = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + update( + params + .toBuilder() + .pathExternalDimensionalPriceGroupId(pathExternalDimensionalPriceGroupId) + .build(), + requestOptions, + ) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ): CompletableFuture = + update(pathExternalDimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see update */ + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + ): CompletableFuture = update(params, RequestOptions.none()) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions, + ) + /** * A view of [ExternalDimensionalPriceGroupIdServiceAsync] that provides access to raw HTTP * responses for each method. @@ -153,5 +212,64 @@ interface ExternalDimensionalPriceGroupIdServiceAsync { DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams.none(), requestOptions, ) + + /** + * Returns a raw HTTP response for `put + * /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}`, + * but is otherwise the same as [ExternalDimensionalPriceGroupIdServiceAsync.update]. + */ + fun update( + pathExternalDimensionalPriceGroupId: String + ): CompletableFuture> = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + update( + params + .toBuilder() + .pathExternalDimensionalPriceGroupId(pathExternalDimensionalPriceGroupId) + .build(), + requestOptions, + ) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ): CompletableFuture> = + update(pathExternalDimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see update */ + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + ): CompletableFuture> = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions, + ) } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt index c9a79447..5ff7c322 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt @@ -13,10 +13,12 @@ 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.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -48,6 +50,14 @@ internal constructor(private val clientOptions: ClientOptions) : // /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id} withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + override fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // put + // /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id} + withRawResponse().update(params, requestOptions).thenApply { it.parse() } + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ExternalDimensionalPriceGroupIdServiceAsync.WithRawResponse { @@ -100,5 +110,46 @@ internal constructor(private val clientOptions: ClientOptions) : } } } + + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired( + "pathExternalDimensionalPriceGroupId", + params.pathExternalDimensionalPriceGroupId().getOrNull(), + ) + val request = + HttpRequest.builder() + .method(HttpMethod.PUT) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "dimensional_price_groups", + "external_dimensional_price_group_id", + params._pathParam(0), + ) + .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 { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupService.kt index a8eb3fa6..f1b1838c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupService.kt @@ -11,6 +11,7 @@ import com.withorb.api.models.DimensionalPriceGroupCreateParams import com.withorb.api.models.DimensionalPriceGroupListPage import com.withorb.api.models.DimensionalPriceGroupListParams import com.withorb.api.models.DimensionalPriceGroupRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupUpdateParams import com.withorb.api.services.blocking.dimensionalPriceGroups.ExternalDimensionalPriceGroupIdService import java.util.function.Consumer @@ -90,6 +91,48 @@ interface DimensionalPriceGroupService { requestOptions, ) + /** + * This endpoint can be used to update the `external_dimensional_price_group_id` and `metadata` + * of an existing dimensional price group. Other fields on a dimensional price group are + * currently immutable. + */ + fun update(dimensionalPriceGroupId: String): DimensionalPriceGroup = + update(dimensionalPriceGroupId, DimensionalPriceGroupUpdateParams.none()) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): DimensionalPriceGroup = + update( + params.toBuilder().dimensionalPriceGroupId(dimensionalPriceGroupId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + ): DimensionalPriceGroup = update(dimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): DimensionalPriceGroup + + /** @see update */ + fun update(params: DimensionalPriceGroupUpdateParams): DimensionalPriceGroup = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + dimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): DimensionalPriceGroup = + update(dimensionalPriceGroupId, DimensionalPriceGroupUpdateParams.none(), requestOptions) + /** List dimensional price groups */ fun list(): DimensionalPriceGroupListPage = list(DimensionalPriceGroupListParams.none()) @@ -197,6 +240,60 @@ interface DimensionalPriceGroupService { requestOptions, ) + /** + * Returns a raw HTTP response for `put + * /dimensional_price_groups/{dimensional_price_group_id}`, but is otherwise the same as + * [DimensionalPriceGroupService.update]. + */ + @MustBeClosed + fun update(dimensionalPriceGroupId: String): HttpResponseFor = + update(dimensionalPriceGroupId, DimensionalPriceGroupUpdateParams.none()) + + /** @see update */ + @MustBeClosed + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + update( + params.toBuilder().dimensionalPriceGroupId(dimensionalPriceGroupId).build(), + requestOptions, + ) + + /** @see update */ + @MustBeClosed + fun update( + dimensionalPriceGroupId: String, + params: DimensionalPriceGroupUpdateParams = DimensionalPriceGroupUpdateParams.none(), + ): HttpResponseFor = + update(dimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see update */ + @MustBeClosed + fun update( + params: DimensionalPriceGroupUpdateParams + ): HttpResponseFor = update(params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + dimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + update( + dimensionalPriceGroupId, + DimensionalPriceGroupUpdateParams.none(), + requestOptions, + ) + /** * Returns a raw HTTP response for `get /dimensional_price_groups`, but is otherwise the * same as [DimensionalPriceGroupService.list]. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt index c682a7f0..10ea3c56 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt @@ -21,6 +21,7 @@ import com.withorb.api.models.DimensionalPriceGroupCreateParams import com.withorb.api.models.DimensionalPriceGroupListPage import com.withorb.api.models.DimensionalPriceGroupListParams import com.withorb.api.models.DimensionalPriceGroupRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupUpdateParams import com.withorb.api.models.DimensionalPriceGroups import com.withorb.api.services.blocking.dimensionalPriceGroups.ExternalDimensionalPriceGroupIdService import com.withorb.api.services.blocking.dimensionalPriceGroups.ExternalDimensionalPriceGroupIdServiceImpl @@ -62,6 +63,13 @@ internal constructor(private val clientOptions: ClientOptions) : DimensionalPric // get /dimensional_price_groups/{dimensional_price_group_id} withRawResponse().retrieve(params, requestOptions).parse() + override fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions, + ): DimensionalPriceGroup = + // put /dimensional_price_groups/{dimensional_price_group_id} + withRawResponse().update(params, requestOptions).parse() + override fun list( params: DimensionalPriceGroupListParams, requestOptions: RequestOptions, @@ -148,6 +156,37 @@ internal constructor(private val clientOptions: ClientOptions) : DimensionalPric } } + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: DimensionalPriceGroupUpdateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("dimensionalPriceGroupId", params.dimensionalPriceGroupId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PUT) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("dimensional_price_groups", params._pathParam(0)) + .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 { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdService.kt index 52bab3a5..17430e4d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdService.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.RequestOptions import com.withorb.api.core.http.HttpResponseFor import com.withorb.api.models.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams import java.util.function.Consumer interface ExternalDimensionalPriceGroupIdService { @@ -78,6 +79,62 @@ interface ExternalDimensionalPriceGroupIdService { requestOptions, ) + /** + * This endpoint can be used to update the `external_dimensional_price_group_id` and `metadata` + * of an existing dimensional price group. Other fields on a dimensional price group are + * currently immutable. + */ + fun update(pathExternalDimensionalPriceGroupId: String): DimensionalPriceGroup = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): DimensionalPriceGroup = + update( + params + .toBuilder() + .pathExternalDimensionalPriceGroupId(pathExternalDimensionalPriceGroupId) + .build(), + requestOptions, + ) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ): DimensionalPriceGroup = + update(pathExternalDimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): DimensionalPriceGroup + + /** @see update */ + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + ): DimensionalPriceGroup = update(params, RequestOptions.none()) + + /** @see update */ + fun update( + pathExternalDimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): DimensionalPriceGroup = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions, + ) + /** * A view of [ExternalDimensionalPriceGroupIdService] that provides access to raw HTTP responses * for each method. @@ -156,5 +213,69 @@ interface ExternalDimensionalPriceGroupIdService { DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams.none(), requestOptions, ) + + /** + * Returns a raw HTTP response for `put + * /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}`, + * but is otherwise the same as [ExternalDimensionalPriceGroupIdService.update]. + */ + @MustBeClosed + fun update( + pathExternalDimensionalPriceGroupId: String + ): HttpResponseFor = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ) + + /** @see update */ + @MustBeClosed + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + update( + params + .toBuilder() + .pathExternalDimensionalPriceGroupId(pathExternalDimensionalPriceGroupId) + .build(), + requestOptions, + ) + + /** @see update */ + @MustBeClosed + fun update( + pathExternalDimensionalPriceGroupId: String, + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + ): HttpResponseFor = + update(pathExternalDimensionalPriceGroupId, params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see update */ + @MustBeClosed + fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams + ): HttpResponseFor = update(params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + pathExternalDimensionalPriceGroupId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + update( + pathExternalDimensionalPriceGroupId, + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.none(), + requestOptions, + ) } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt index 04b95cdf..bdcef30a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt @@ -13,10 +13,12 @@ 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.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams +import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -46,6 +48,14 @@ internal constructor(private val clientOptions: ClientOptions) : // /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id} withRawResponse().retrieve(params, requestOptions).parse() + override fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions, + ): DimensionalPriceGroup = + // put + // /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id} + withRawResponse().update(params, requestOptions).parse() + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ExternalDimensionalPriceGroupIdService.WithRawResponse { @@ -95,5 +105,43 @@ internal constructor(private val clientOptions: ClientOptions) : } } } + + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired( + "pathExternalDimensionalPriceGroupId", + params.pathExternalDimensionalPriceGroupId().getOrNull(), + ) + val request = + HttpRequest.builder() + .method(HttpMethod.PUT) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "dimensional_price_groups", + "external_dimensional_price_group_id", + params._pathParam(0), + ) + .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 { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParamsTest.kt new file mode 100644 index 00000000..8e7b8408 --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParamsTest.kt @@ -0,0 +1,71 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.JsonValue +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParamsTest { + + @Test + fun create() { + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.builder() + .pathExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .bodyExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + } + + @Test + fun pathParams() { + val params = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.builder() + .pathExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .build() + + assertThat(params._pathParam(0)).isEqualTo("external_dimensional_price_group_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.builder() + .pathExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .bodyExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.Metadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + + val body = params._body() + + assertThat(body.bodyExternalDimensionalPriceGroupId()) + .contains("external_dimensional_price_group_id") + assertThat(body.metadata()) + .contains( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.builder() + .pathExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .build() + + val body = params._body() + } +} diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupUpdateParamsTest.kt new file mode 100644 index 00000000..08de05fb --- /dev/null +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupUpdateParamsTest.kt @@ -0,0 +1,70 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.withorb.api.models + +import com.withorb.api.core.JsonValue +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class DimensionalPriceGroupUpdateParamsTest { + + @Test + fun create() { + DimensionalPriceGroupUpdateParams.builder() + .dimensionalPriceGroupId("dimensional_price_group_id") + .externalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + } + + @Test + fun pathParams() { + val params = + DimensionalPriceGroupUpdateParams.builder() + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + + assertThat(params._pathParam(0)).isEqualTo("dimensional_price_group_id") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + DimensionalPriceGroupUpdateParams.builder() + .dimensionalPriceGroupId("dimensional_price_group_id") + .externalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + + val body = params._body() + + assertThat(body.externalDimensionalPriceGroupId()) + .contains("external_dimensional_price_group_id") + assertThat(body.metadata()) + .contains( + DimensionalPriceGroupUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + DimensionalPriceGroupUpdateParams.builder() + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + + val body = params._body() + } +} 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 a3ea6229..76fbac95 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 @@ -147,6 +147,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -394,6 +395,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -655,6 +657,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -921,6 +924,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -1187,6 +1191,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -1443,6 +1448,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -1700,6 +1706,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -1961,6 +1968,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -2219,6 +2227,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -2472,6 +2481,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -2725,6 +2735,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -2978,6 +2989,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -3231,6 +3243,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -3484,6 +3497,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -3737,6 +3751,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -3998,6 +4013,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -4259,6 +4275,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -4512,6 +4529,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -4765,6 +4783,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -5018,6 +5037,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -5271,6 +5291,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -5524,6 +5545,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -5777,6 +5799,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -6030,6 +6053,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -6283,6 +6307,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -6537,6 +6562,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).contains(scalableMatrixWithUnitPricing) assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -6793,6 +6819,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithTieredPricing()) .contains(scalableMatrixWithTieredPricing) assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -7047,6 +7074,7 @@ internal class PriceTest { assertThat(price.scalableMatrixWithUnitPricing()).isEmpty assertThat(price.scalableMatrixWithTieredPricing()).isEmpty assertThat(price.cumulativeGroupedBulk()).contains(cumulativeGroupedBulk) + assertThat(price.groupedWithMinMaxThresholds()).isEmpty } @Test @@ -7164,6 +7192,261 @@ internal class PriceTest { assertThat(roundtrippedPrice).isEqualTo(price) } + @Test + fun ofGroupedWithMinMaxThresholds() { + val groupedWithMinMaxThresholds = + Price.GroupedWithMinMaxThresholds.builder() + .id("id") + .billableMetric(BillableMetricTiny.builder().id("id").build()) + .billingCycleConfiguration( + BillingCycleConfiguration.builder() + .duration(0L) + .durationUnit(BillingCycleConfiguration.DurationUnit.DAY) + .build() + ) + .cadence(Price.GroupedWithMinMaxThresholds.Cadence.ONE_TIME) + .conversionRate(0.0) + .unitConversionRateConfig( + ConversionRateUnitConfig.builder().unitAmount("unit_amount").build() + ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .creditAllocation( + Allocation.builder() + .allowsRollover(true) + .currency("currency") + .customExpiration( + CustomExpiration.builder() + .duration(0L) + .durationUnit(CustomExpiration.DurationUnit.DAY) + .build() + ) + .build() + ) + .currency("currency") + .discount( + PercentageDiscount.builder() + .discountType(PercentageDiscount.DiscountType.PERCENTAGE) + .percentageDiscount(0.15) + .addAppliesToPriceId("h74gfhdjvn7ujokd") + .addAppliesToPriceId("7hfgtgjnbvc3ujkl") + .addFilter( + TransformPriceFilter.builder() + .field(TransformPriceFilter.Field.PRICE_ID) + .operator(TransformPriceFilter.Operator.INCLUDES) + .addValue("string") + .build() + ) + .reason("reason") + .build() + ) + .externalPriceId("external_price_id") + .fixedPriceQuantity(0.0) + .groupedWithMinMaxThresholdsConfig( + Price.GroupedWithMinMaxThresholds.GroupedWithMinMaxThresholdsConfig.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .invoicingCycleConfiguration( + BillingCycleConfiguration.builder() + .duration(0L) + .durationUnit(BillingCycleConfiguration.DurationUnit.DAY) + .build() + ) + .item(ItemSlim.builder().id("id").name("name").build()) + .maximum( + Maximum.builder() + .addAppliesToPriceId("string") + .addFilter( + TransformPriceFilter.builder() + .field(TransformPriceFilter.Field.PRICE_ID) + .operator(TransformPriceFilter.Operator.INCLUDES) + .addValue("string") + .build() + ) + .maximumAmount("maximum_amount") + .build() + ) + .maximumAmount("maximum_amount") + .metadata( + Price.GroupedWithMinMaxThresholds.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .minimum( + Minimum.builder() + .addAppliesToPriceId("string") + .addFilter( + TransformPriceFilter.builder() + .field(TransformPriceFilter.Field.PRICE_ID) + .operator(TransformPriceFilter.Operator.INCLUDES) + .addValue("string") + .build() + ) + .minimumAmount("minimum_amount") + .build() + ) + .minimumAmount("minimum_amount") + .name("name") + .planPhaseOrder(0L) + .priceType(Price.GroupedWithMinMaxThresholds.PriceType.USAGE_PRICE) + .replacesPriceId("replaces_price_id") + .dimensionalPriceConfiguration( + DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) + .build() + + val price = Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds) + + assertThat(price.unit()).isEmpty + assertThat(price.package_()).isEmpty + assertThat(price.matrix()).isEmpty + assertThat(price.tiered()).isEmpty + assertThat(price.tieredBps()).isEmpty + assertThat(price.bps()).isEmpty + assertThat(price.bulkBps()).isEmpty + assertThat(price.bulk()).isEmpty + assertThat(price.thresholdTotalAmount()).isEmpty + assertThat(price.tieredPackage()).isEmpty + assertThat(price.groupedTiered()).isEmpty + assertThat(price.tieredWithMinimum()).isEmpty + assertThat(price.tieredPackageWithMinimum()).isEmpty + assertThat(price.packageWithAllocation()).isEmpty + assertThat(price.unitWithPercent()).isEmpty + assertThat(price.matrixWithAllocation()).isEmpty + assertThat(price.tieredWithProration()).isEmpty + assertThat(price.unitWithProration()).isEmpty + assertThat(price.groupedAllocation()).isEmpty + assertThat(price.groupedWithProratedMinimum()).isEmpty + assertThat(price.groupedWithMeteredMinimum()).isEmpty + assertThat(price.matrixWithDisplayName()).isEmpty + assertThat(price.bulkWithProration()).isEmpty + assertThat(price.groupedTieredPackage()).isEmpty + assertThat(price.maxGroupTieredPackage()).isEmpty + assertThat(price.scalableMatrixWithUnitPricing()).isEmpty + assertThat(price.scalableMatrixWithTieredPricing()).isEmpty + assertThat(price.cumulativeGroupedBulk()).isEmpty + assertThat(price.groupedWithMinMaxThresholds()).contains(groupedWithMinMaxThresholds) + } + + @Test + fun ofGroupedWithMinMaxThresholdsRoundtrip() { + val jsonMapper = jsonMapper() + val price = + Price.ofGroupedWithMinMaxThresholds( + Price.GroupedWithMinMaxThresholds.builder() + .id("id") + .billableMetric(BillableMetricTiny.builder().id("id").build()) + .billingCycleConfiguration( + BillingCycleConfiguration.builder() + .duration(0L) + .durationUnit(BillingCycleConfiguration.DurationUnit.DAY) + .build() + ) + .cadence(Price.GroupedWithMinMaxThresholds.Cadence.ONE_TIME) + .conversionRate(0.0) + .unitConversionRateConfig( + ConversionRateUnitConfig.builder().unitAmount("unit_amount").build() + ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .creditAllocation( + Allocation.builder() + .allowsRollover(true) + .currency("currency") + .customExpiration( + CustomExpiration.builder() + .duration(0L) + .durationUnit(CustomExpiration.DurationUnit.DAY) + .build() + ) + .build() + ) + .currency("currency") + .discount( + PercentageDiscount.builder() + .discountType(PercentageDiscount.DiscountType.PERCENTAGE) + .percentageDiscount(0.15) + .addAppliesToPriceId("h74gfhdjvn7ujokd") + .addAppliesToPriceId("7hfgtgjnbvc3ujkl") + .addFilter( + TransformPriceFilter.builder() + .field(TransformPriceFilter.Field.PRICE_ID) + .operator(TransformPriceFilter.Operator.INCLUDES) + .addValue("string") + .build() + ) + .reason("reason") + .build() + ) + .externalPriceId("external_price_id") + .fixedPriceQuantity(0.0) + .groupedWithMinMaxThresholdsConfig( + Price.GroupedWithMinMaxThresholds.GroupedWithMinMaxThresholdsConfig + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .invoicingCycleConfiguration( + BillingCycleConfiguration.builder() + .duration(0L) + .durationUnit(BillingCycleConfiguration.DurationUnit.DAY) + .build() + ) + .item(ItemSlim.builder().id("id").name("name").build()) + .maximum( + Maximum.builder() + .addAppliesToPriceId("string") + .addFilter( + TransformPriceFilter.builder() + .field(TransformPriceFilter.Field.PRICE_ID) + .operator(TransformPriceFilter.Operator.INCLUDES) + .addValue("string") + .build() + ) + .maximumAmount("maximum_amount") + .build() + ) + .maximumAmount("maximum_amount") + .metadata( + Price.GroupedWithMinMaxThresholds.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .minimum( + Minimum.builder() + .addAppliesToPriceId("string") + .addFilter( + TransformPriceFilter.builder() + .field(TransformPriceFilter.Field.PRICE_ID) + .operator(TransformPriceFilter.Operator.INCLUDES) + .addValue("string") + .build() + ) + .minimumAmount("minimum_amount") + .build() + ) + .minimumAmount("minimum_amount") + .name("name") + .planPhaseOrder(0L) + .priceType(Price.GroupedWithMinMaxThresholds.PriceType.USAGE_PRICE) + .replacesPriceId("replaces_price_id") + .dimensionalPriceConfiguration( + DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) + .build() + ) + + val roundtrippedPrice = + jsonMapper.readValue(jsonMapper.writeValueAsString(price), jacksonTypeRef()) + + assertThat(roundtrippedPrice).isEqualTo(price) + } + enum class IncompatibleJsonShapeTestCase(val value: JsonValue) { BOOLEAN(JsonValue.from(false)), STRING(JsonValue.from("invalid")), diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncTest.kt index 2eb8b99a..a80f5739 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncTest.kt @@ -6,6 +6,7 @@ import com.withorb.api.TestServerExtension import com.withorb.api.client.okhttp.OrbOkHttpClientAsync import com.withorb.api.core.JsonValue import com.withorb.api.models.DimensionalPriceGroupCreateParams +import com.withorb.api.models.DimensionalPriceGroupUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -57,6 +58,32 @@ internal class DimensionalPriceGroupServiceAsyncTest { dimensionalPriceGroup.validate() } + @Test + fun update() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val dimensionalPriceGroupServiceAsync = client.dimensionalPriceGroups() + + val dimensionalPriceGroupFuture = + dimensionalPriceGroupServiceAsync.update( + DimensionalPriceGroupUpdateParams.builder() + .dimensionalPriceGroupId("dimensional_price_group_id") + .externalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + ) + + val dimensionalPriceGroup = dimensionalPriceGroupFuture.get() + dimensionalPriceGroup.validate() + } + @Test fun list() { val client = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncTest.kt index 7a286bbe..6f06d78d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncTest.kt @@ -4,6 +4,8 @@ package com.withorb.api.services.async.dimensionalPriceGroups import com.withorb.api.TestServerExtension import com.withorb.api.client.okhttp.OrbOkHttpClientAsync +import com.withorb.api.core.JsonValue +import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -28,4 +30,32 @@ internal class ExternalDimensionalPriceGroupIdServiceAsyncTest { val dimensionalPriceGroup = dimensionalPriceGroupFuture.get() dimensionalPriceGroup.validate() } + + @Test + fun update() { + val client = + OrbOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val externalDimensionalPriceGroupIdServiceAsync = + client.dimensionalPriceGroups().externalDimensionalPriceGroupId() + + val dimensionalPriceGroupFuture = + externalDimensionalPriceGroupIdServiceAsync.update( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.builder() + .pathExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .bodyExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.Metadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + ) + + val dimensionalPriceGroup = dimensionalPriceGroupFuture.get() + dimensionalPriceGroup.validate() + } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceTest.kt index 8b74b1d2..91112f89 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceTest.kt @@ -6,6 +6,7 @@ import com.withorb.api.TestServerExtension import com.withorb.api.client.okhttp.OrbOkHttpClient import com.withorb.api.core.JsonValue import com.withorb.api.models.DimensionalPriceGroupCreateParams +import com.withorb.api.models.DimensionalPriceGroupUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -55,6 +56,31 @@ internal class DimensionalPriceGroupServiceTest { dimensionalPriceGroup.validate() } + @Test + fun update() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val dimensionalPriceGroupService = client.dimensionalPriceGroups() + + val dimensionalPriceGroup = + dimensionalPriceGroupService.update( + DimensionalPriceGroupUpdateParams.builder() + .dimensionalPriceGroupId("dimensional_price_group_id") + .externalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + ) + + dimensionalPriceGroup.validate() + } + @Test fun list() { val client = diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceTest.kt index 4831999e..5d37df63 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceTest.kt @@ -4,6 +4,8 @@ package com.withorb.api.services.blocking.dimensionalPriceGroups import com.withorb.api.TestServerExtension import com.withorb.api.client.okhttp.OrbOkHttpClient +import com.withorb.api.core.JsonValue +import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -25,4 +27,31 @@ internal class ExternalDimensionalPriceGroupIdServiceTest { dimensionalPriceGroup.validate() } + + @Test + fun update() { + val client = + OrbOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val externalDimensionalPriceGroupIdService = + client.dimensionalPriceGroups().externalDimensionalPriceGroupId() + + val dimensionalPriceGroup = + externalDimensionalPriceGroupIdService.update( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.builder() + .pathExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .bodyExternalDimensionalPriceGroupId("external_dimensional_price_group_id") + .metadata( + DimensionalPriceGroupExternalDimensionalPriceGroupIdUpdateParams.Metadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + ) + + dimensionalPriceGroup.validate() + } }