From f8b95feb77e2ad2f0fc9f9ace604cfe9a60c012a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 22:28:12 +0000 Subject: [PATCH 01/10] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9450f45c5..20f408c90 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-612316c13276a207f56e2e2c7bbc68f4bb73de85e3661595a23f23d9ccc80276.yml openapi_spec_hash: 6e125f05e40521ec485edf6e15beec2e -config_hash: 8c9a47f104c777e2a1e8f3fad15c093b +config_hash: 1f535c1fa222aacf28b636eed21bec72 From 7c7a621be47edaca08972e0986c72dab410ec052 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 22:35:22 +0000 Subject: [PATCH 02/10] feat(api): api update --- .stats.yml | 4 ++-- src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs | 2 +- src/Orb/Models/Customers/Costs/CostListParams.cs | 2 +- src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 20f408c90..580e92e5a 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-612316c13276a207f56e2e2c7bbc68f4bb73de85e3661595a23f23d9ccc80276.yml -openapi_spec_hash: 6e125f05e40521ec485edf6e15beec2e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-373ca3e805c414f75a90b0088c57cbb60ff207abdca0a8e397c551de88606c4a.yml +openapi_spec_hash: 1c30d01bd9c38f8a2aa4bd088fbe69bc config_hash: 1f535c1fa222aacf28b636eed21bec72 diff --git a/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs b/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs index 9f24c587e..cccba1bf0 100644 --- a/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs +++ b/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs @@ -107,7 +107,7 @@ public sealed record class CostListByExternalIDParams : Orb::ParamsBase public required string ExternalCustomerID; /// - /// The currency or custom pricing unit to use. + /// The currency to use. /// public string? Currency { diff --git a/src/Orb/Models/Customers/Costs/CostListParams.cs b/src/Orb/Models/Customers/Costs/CostListParams.cs index 34e1dbda2..677b0fc27 100644 --- a/src/Orb/Models/Customers/Costs/CostListParams.cs +++ b/src/Orb/Models/Customers/Costs/CostListParams.cs @@ -107,7 +107,7 @@ public sealed record class CostListParams : Orb::ParamsBase public required string CustomerID; /// - /// The currency or custom pricing unit to use. + /// The currency to use. /// public string? Currency { diff --git a/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs b/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs index 0b975710f..586984524 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs @@ -22,7 +22,7 @@ public sealed record class SubscriptionFetchCostsParams : Orb::ParamsBase public required string SubscriptionID; /// - /// The currency or custom pricing unit to use. + /// The currency to use. /// public string? Currency { From 268fdab77f42a6e87ffc2f7fd1863bbd05d30033 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:43:51 +0000 Subject: [PATCH 03/10] feat(api): api update --- .stats.yml | 4 +- .../Service/Invoices/InvoiceServiceTest.cs | 2 +- .../Models/Invoices/InvoiceCreateParams.cs | 39 +++++++++---------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index 580e92e5a..5a4c2212f 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-373ca3e805c414f75a90b0088c57cbb60ff207abdca0a8e397c551de88606c4a.yml -openapi_spec_hash: 1c30d01bd9c38f8a2aa4bd088fbe69bc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a44cccd16bb58080f7cc0669999403f6ed3f77287fad901caa6fd2523f2fbafd.yml +openapi_spec_hash: af6444648d0b2a70b7f7ad234bd37541 config_hash: 1f535c1fa222aacf28b636eed21bec72 diff --git a/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs b/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs index 39d6aed28..ae1b4e812 100644 --- a/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs +++ b/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs @@ -34,7 +34,6 @@ public class InvoiceServiceTest : Tests::TestBase UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, }, ], - NetTerms = 0, CustomerID = "4khy3nwzktxv7", Discount = Models::Discount.Create( new Models::PercentageDiscount() @@ -57,6 +56,7 @@ public class InvoiceServiceTest : Tests::TestBase ExternalCustomerID = "external-customer-id", Memo = "An optional memo for my invoice.", Metadata = new() { { "foo", "string" } }, + NetTerms = 0, WillAutoIssue = false, } ); diff --git a/src/Orb/Models/Invoices/InvoiceCreateParams.cs b/src/Orb/Models/Invoices/InvoiceCreateParams.cs index 3b9959082..d19fca744 100644 --- a/src/Orb/Models/Invoices/InvoiceCreateParams.cs +++ b/src/Orb/Models/Invoices/InvoiceCreateParams.cs @@ -75,27 +75,6 @@ public required string Currency set { this.BodyProperties["line_items"] = Json::JsonSerializer.SerializeToElement(value); } } - /// - /// Determines the difference between the invoice issue date for subscription invoices - /// as the date that they are due. A value of '0' here represents that the invoice - /// is due on issue, whereas a value of 30 represents that the customer has 30 days - /// to pay the invoice. - /// - public required long NetTerms - { - get - { - if (!this.BodyProperties.TryGetValue("net_terms", out Json::JsonElement element)) - throw new System::ArgumentOutOfRangeException( - "net_terms", - "Missing required argument" - ); - - return Json::JsonSerializer.Deserialize(element); - } - set { this.BodyProperties["net_terms"] = Json::JsonSerializer.SerializeToElement(value); } - } - /// /// The id of the `Customer` to create this invoice for. One of `customer_id` and /// `external_customer_id` are required. @@ -185,6 +164,24 @@ public string? Memo set { this.BodyProperties["metadata"] = Json::JsonSerializer.SerializeToElement(value); } } + /// + /// Determines the difference between the invoice issue date for subscription invoices + /// as the date that they are due. A value of '0' here represents that the invoice + /// is due on issue, whereas a value of 30 represents that the customer has 30 days + /// to pay the invoice. + /// + public long? NetTerms + { + get + { + if (!this.BodyProperties.TryGetValue("net_terms", out Json::JsonElement element)) + return null; + + return Json::JsonSerializer.Deserialize(element); + } + set { this.BodyProperties["net_terms"] = Json::JsonSerializer.SerializeToElement(value); } + } + /// /// When true, this invoice will be submitted for issuance upon creation. When false, /// the resulting invoice will require manual review to issue. Defaulted to false. From d0d1a7995095b23506e98a0ba0e5bdb47370dc5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:07:42 +0000 Subject: [PATCH 04/10] feat(api): api update --- .stats.yml | 4 ++-- .../Models/Customers/Costs/CostListByExternalIDParams.cs | 2 +- src/Orb/Models/Customers/Costs/CostListParams.cs | 2 +- .../IncrementProperties/InvoiceSettings.cs | 4 ++-- .../IncrementProperties/InvoiceSettings.cs | 4 ++-- .../Models/Customers/CustomerUpdateByExternalIDParams.cs | 6 ++++-- src/Orb/Models/Customers/CustomerUpdateParams.cs | 6 ++++-- src/Orb/Models/Invoices/InvoiceUpdateParams.cs | 9 +++++---- .../Models/Subscriptions/SubscriptionFetchCostsParams.cs | 2 +- src/Orb/Service/Invoices/IInvoiceService.cs | 9 +++++---- 10 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5a4c2212f..82cec55fd 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-a44cccd16bb58080f7cc0669999403f6ed3f77287fad901caa6fd2523f2fbafd.yml -openapi_spec_hash: af6444648d0b2a70b7f7ad234bd37541 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1aabbd8715a871e993abf67f0bf9c1d6793b4f197c4b2f11fc7a76453590cd6c.yml +openapi_spec_hash: 3e5878f87e74881d882a69e1ccdc25a3 config_hash: 1f535c1fa222aacf28b636eed21bec72 diff --git a/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs b/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs index cccba1bf0..9f24c587e 100644 --- a/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs +++ b/src/Orb/Models/Customers/Costs/CostListByExternalIDParams.cs @@ -107,7 +107,7 @@ public sealed record class CostListByExternalIDParams : Orb::ParamsBase public required string ExternalCustomerID; /// - /// The currency to use. + /// The currency or custom pricing unit to use. /// public string? Currency { diff --git a/src/Orb/Models/Customers/Costs/CostListParams.cs b/src/Orb/Models/Customers/Costs/CostListParams.cs index 677b0fc27..34e1dbda2 100644 --- a/src/Orb/Models/Customers/Costs/CostListParams.cs +++ b/src/Orb/Models/Customers/Costs/CostListParams.cs @@ -107,7 +107,7 @@ public sealed record class CostListParams : Orb::ParamsBase public required string CustomerID; /// - /// The currency to use. + /// The currency or custom pricing unit to use. /// public string? Currency { diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs index a5ca54393..37f9a59be 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs @@ -40,7 +40,7 @@ public required bool AutoCollection /// date for the invoice. If you intend the invoice to be due on issue, set this /// to 0. /// - public required long NetTerms + public required long? NetTerms { get { @@ -50,7 +50,7 @@ public required long NetTerms "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["net_terms"] = Json::JsonSerializer.SerializeToElement(value); } } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs index deca99cec..039969c4f 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs @@ -40,7 +40,7 @@ public required bool AutoCollection /// date for the invoice. If you intend the invoice to be due on issue, set this /// to 0. /// - public required long NetTerms + public required long? NetTerms { get { @@ -50,7 +50,7 @@ public required long NetTerms "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["net_terms"] = Json::JsonSerializer.SerializeToElement(value); } } diff --git a/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs index ab7c47664..3e2a79d30 100644 --- a/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs +++ b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs @@ -146,8 +146,10 @@ public bool? EmailDelivery } /// - /// The external customer ID. This can only be set if empty and the customer has - /// no past or current subscriptions. + /// The external customer ID. This can only be set if the customer has no existing + /// external customer ID. Since this action may change usage quantities for all + /// existing subscriptions, it is disallowed if the customer has issued invoices + /// with usage line items and subject to the same restrictions as backdated subscription creation. /// public string? ExternalCustomerID { diff --git a/src/Orb/Models/Customers/CustomerUpdateParams.cs b/src/Orb/Models/Customers/CustomerUpdateParams.cs index 8899481e3..410645809 100644 --- a/src/Orb/Models/Customers/CustomerUpdateParams.cs +++ b/src/Orb/Models/Customers/CustomerUpdateParams.cs @@ -147,8 +147,10 @@ public bool? EmailDelivery } /// - /// The external customer ID. This can only be set if empty and the customer has - /// no past or current subscriptions. + /// The external customer ID. This can only be set if the customer has no existing + /// external customer ID. Since this action may change usage quantities for all + /// existing subscriptions, it is disallowed if the customer has issued invoices + /// with usage line items and subject to the same restrictions as backdated subscription creation. /// public string? ExternalCustomerID { diff --git a/src/Orb/Models/Invoices/InvoiceUpdateParams.cs b/src/Orb/Models/Invoices/InvoiceUpdateParams.cs index ce5bb1600..17f040a6f 100644 --- a/src/Orb/Models/Invoices/InvoiceUpdateParams.cs +++ b/src/Orb/Models/Invoices/InvoiceUpdateParams.cs @@ -8,11 +8,12 @@ namespace Orb.Models.Invoices; /// -/// This endpoint allows you to update the `metadata` property on an invoice. If -/// you pass null for the metadata value, it will clear any existing metadata for -/// that invoice. +/// This endpoint allows you to update the `metadata`, `net_terms`, and `due_date` +/// properties on an invoice. If you pass null for the metadata value, it will clear +/// any existing metadata for that invoice. /// -/// `metadata` can be modified regardless of invoice state. +/// `metadata` can be modified regardless of invoice state. `net_terms` and `due_date` +/// can only be modified if the invoice is in a `draft` state. /// public sealed record class InvoiceUpdateParams : Orb::ParamsBase { diff --git a/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs b/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs index 586984524..0b975710f 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionFetchCostsParams.cs @@ -22,7 +22,7 @@ public sealed record class SubscriptionFetchCostsParams : Orb::ParamsBase public required string SubscriptionID; /// - /// The currency to use. + /// The currency or custom pricing unit to use. /// public string? Currency { diff --git a/src/Orb/Service/Invoices/IInvoiceService.cs b/src/Orb/Service/Invoices/IInvoiceService.cs index fb7b8fad2..47ceeb200 100644 --- a/src/Orb/Service/Invoices/IInvoiceService.cs +++ b/src/Orb/Service/Invoices/IInvoiceService.cs @@ -12,11 +12,12 @@ public interface IInvoiceService Tasks::Task Create(Invoices::InvoiceCreateParams @params); /// - /// This endpoint allows you to update the `metadata` property on an invoice. If - /// you pass null for the metadata value, it will clear any existing metadata for - /// that invoice. + /// This endpoint allows you to update the `metadata`, `net_terms`, and `due_date` + /// properties on an invoice. If you pass null for the metadata value, it will + /// clear any existing metadata for that invoice. /// - /// `metadata` can be modified regardless of invoice state. + /// `metadata` can be modified regardless of invoice state. `net_terms` and `due_date` + /// can only be modified if the invoice is in a `draft` state. /// Tasks::Task Update(Invoices::InvoiceUpdateParams @params); From 3167be06e8e3929b18e0d4d6af09f69608e68515 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:06:32 +0000 Subject: [PATCH 05/10] docs: note alpha status --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 98a53c1d3..237927bf3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Orb C# API Library +> [!NOTE] +> The Orb C# API Library is currently in alpha. +> +> There may be frequent breaking changes. + The Orb C# SDK provides convenient access to the [Orb REST API](https://docs.withorb.com/reference/api-reference) from applications written in C#. The REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference). From b08df824c44e6cc0ac72d42b07c3c089f501862d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 00:23:50 +0000 Subject: [PATCH 06/10] feat(api): api update --- .stats.yml | 8 +- .../DimensionalPriceGroupServiceTest.cs | 14 + ...ernalDimensionalPriceGroupIDServiceTest.cs | 15 + src/Orb/Models/CustomerTaxID.cs | 195 +++---- .../Models/CustomerTaxIDProperties/Country.cs | 152 ++++- .../Models/CustomerTaxIDProperties/Type.cs | 156 +++++ src/Orb/Models/Customers/Customer.cs | 201 ++++--- .../Models/Customers/CustomerCreateParams.cs | 201 ++++--- .../CustomerUpdateByExternalIDParams.cs | 201 ++++--- .../Models/Customers/CustomerUpdateParams.cs | 201 ++++--- .../DimensionalPriceGroupUpdateParams.cs | 92 +++ ...rnalDimensionalPriceGroupIDUpdateParams.cs | 95 +++ src/Orb/Models/Invoice.cs | 201 ++++--- .../Invoices/InvoiceFetchUpcomingResponse.cs | 201 ++++--- src/Orb/Models/Price.cs | 4 + .../GroupedWithMinMaxThresholds.cs | 541 ++++++++++++++++++ .../Cadence.cs | 60 ++ .../ConversionRateConfig.cs | 22 + .../ConversionRateConfigVariants/All.cs | 42 ++ .../ModelType.cs | 42 ++ .../PriceType.cs | 44 ++ src/Orb/Models/PriceVariants/All.cs | 25 + .../DimensionalPriceGroupService.cs | 23 + .../ExternalDimensionalPriceGroupIDService.cs | 23 + ...IExternalDimensionalPriceGroupIDService.cs | 9 + .../IDimensionalPriceGroupService.cs | 9 + 26 files changed, 2033 insertions(+), 744 deletions(-) create mode 100644 src/Orb/Models/DimensionalPriceGroups/DimensionalPriceGroupUpdateParams.cs create mode 100644 src/Orb/Models/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDUpdateParams.cs create mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs create mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/Cadence.cs create mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs create mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfigVariants/All.cs create mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs create mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/PriceType.cs diff --git a/.stats.yml b/.stats.yml index 82cec55fd..c03739d1c 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/src/Orb.Tests/Service/DimensionalPriceGroups/DimensionalPriceGroupServiceTest.cs b/src/Orb.Tests/Service/DimensionalPriceGroups/DimensionalPriceGroupServiceTest.cs index 64882f8ff..7672d3494 100644 --- a/src/Orb.Tests/Service/DimensionalPriceGroups/DimensionalPriceGroupServiceTest.cs +++ b/src/Orb.Tests/Service/DimensionalPriceGroups/DimensionalPriceGroupServiceTest.cs @@ -34,6 +34,20 @@ public class DimensionalPriceGroupServiceTest : Tests::TestBase dimensionalPriceGroup.Validate(); } + [Fact] + public async Tasks::Task Update_Works() + { + var dimensionalPriceGroup = await this.client.DimensionalPriceGroups.Update( + new DimensionalPriceGroups::DimensionalPriceGroupUpdateParams() + { + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = "external_dimensional_price_group_id", + Metadata = new() { { "foo", "string" } }, + } + ); + dimensionalPriceGroup.Validate(); + } + [Fact] public async Tasks::Task List_Works() { diff --git a/src/Orb.Tests/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDServiceTest.cs b/src/Orb.Tests/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDServiceTest.cs index 204fb06e0..f0f7da033 100644 --- a/src/Orb.Tests/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDServiceTest.cs +++ b/src/Orb.Tests/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDServiceTest.cs @@ -18,4 +18,19 @@ await this.client.DimensionalPriceGroups.ExternalDimensionalPriceGroupID.Retriev ); dimensionalPriceGroup.Validate(); } + + [Fact] + public async Tasks::Task Update_Works() + { + var dimensionalPriceGroup = + await this.client.DimensionalPriceGroups.ExternalDimensionalPriceGroupID.Update( + new ExternalDimensionalPriceGroupID::ExternalDimensionalPriceGroupIDUpdateParams() + { + ExternalDimensionalPriceGroupID = "external_dimensional_price_group_id", + ExternalDimensionalPriceGroupID1 = "external_dimensional_price_group_id", + Metadata = new() { { "foo", "string" } }, + } + ); + dimensionalPriceGroup.Validate(); + } } diff --git a/src/Orb/Models/CustomerTaxID.cs b/src/Orb/Models/CustomerTaxID.cs index 4c9d3e698..2df80d9c0 100644 --- a/src/Orb/Models/CustomerTaxID.cs +++ b/src/Orb/Models/CustomerTaxID.cs @@ -14,108 +14,99 @@ namespace Orb.Models; /// /// ### 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 | /// [Serialization::JsonConverter(typeof(Orb::ModelConverter))] public sealed record class CustomerTaxID : Orb::ModelBase, Orb::IFromRaw diff --git a/src/Orb/Models/CustomerTaxIDProperties/Country.cs b/src/Orb/Models/CustomerTaxIDProperties/Country.cs index 49c6cac34..7113440f4 100644 --- a/src/Orb/Models/CustomerTaxIDProperties/Country.cs +++ b/src/Orb/Models/CustomerTaxIDProperties/Country.cs @@ -11,52 +11,84 @@ public sealed record class Country(string value) : Orb::IEnum public static readonly Country Ae = new("AE"); + public static readonly Country Al = new("AL"); + + public static readonly Country Am = new("AM"); + + public static readonly Country Ao = new("AO"); + public static readonly Country Ar = new("AR"); public static readonly Country At = new("AT"); public static readonly Country Au = new("AU"); + public static readonly Country Aw = new("AW"); + + public static readonly Country Az = new("AZ"); + + public static readonly Country Ba = new("BA"); + + public static readonly Country Bb = new("BB"); + + public static readonly Country Bd = new("BD"); + public static readonly Country Be = new("BE"); + public static readonly Country Bf = new("BF"); + public static readonly Country Bg = new("BG"); public static readonly Country Bh = new("BH"); + public static readonly Country Bj = new("BJ"); + public static readonly Country Bo = new("BO"); public static readonly Country Br = new("BR"); + public static readonly Country Bs = new("BS"); + + public static readonly Country By = new("BY"); + public static readonly Country Ca = new("CA"); + public static readonly Country Cd = new("CD"); + public static readonly Country Ch = new("CH"); public static readonly Country Cl = new("CL"); + public static readonly Country Cm = new("CM"); + public static readonly Country Cn = new("CN"); public static readonly Country Co = new("CO"); public static readonly Country Cr = new("CR"); + public static readonly Country Cv = new("CV"); + + public static readonly Country De = new("DE"); + public static readonly Country Cy = new("CY"); public static readonly Country Cz = new("CZ"); - public static readonly Country De = new("DE"); - public static readonly Country Dk = new("DK"); - public static readonly Country Ee = new("EE"); - public static readonly Country Do = new("DO"); public static readonly Country Ec = new("EC"); + public static readonly Country Ee = new("EE"); + public static readonly Country Eg = new("EG"); public static readonly Country Es = new("ES"); + public static readonly Country Et = new("ET"); + public static readonly Country Eu = new("EU"); public static readonly Country Fi = new("FI"); @@ -67,6 +99,8 @@ public sealed record class Country(string value) : Orb::IEnum public static readonly Country Ge = new("GE"); + public static readonly Country Gn = new("GN"); + public static readonly Country Gr = new("GR"); public static readonly Country Hk = new("HK"); @@ -91,10 +125,16 @@ public sealed record class Country(string value) : Orb::IEnum public static readonly Country Ke = new("KE"); + public static readonly Country Kg = new("KG"); + + public static readonly Country Kh = new("KH"); + public static readonly Country Kr = new("KR"); public static readonly Country Kz = new("KZ"); + public static readonly Country La = new("LA"); + public static readonly Country Li = new("LI"); public static readonly Country Lt = new("LT"); @@ -103,6 +143,16 @@ public sealed record class Country(string value) : Orb::IEnum public static readonly Country Lv = new("LV"); + public static readonly Country Ma = new("MA"); + + public static readonly Country Md = new("MD"); + + public static readonly Country Me = new("ME"); + + public static readonly Country Mk = new("MK"); + + public static readonly Country Mr = new("MR"); + public static readonly Country Mt = new("MT"); public static readonly Country Mx = new("MX"); @@ -115,6 +165,8 @@ public sealed record class Country(string value) : Orb::IEnum public static readonly Country No = new("NO"); + public static readonly Country Np = new("NP"); + public static readonly Country Nz = new("NZ"); public static readonly Country Om = new("OM"); @@ -143,60 +195,93 @@ public sealed record class Country(string value) : Orb::IEnum public static readonly Country Sk = new("SK"); + public static readonly Country Sn = new("SN"); + + public static readonly Country Sr = new("SR"); + public static readonly Country Sv = new("SV"); public static readonly Country Th = new("TH"); + public static readonly Country Tj = new("TJ"); + public static readonly Country Tr = new("TR"); public static readonly Country Tw = new("TW"); + public static readonly Country Tz = new("TZ"); + public static readonly Country Ua = new("UA"); + public static readonly Country Ug = new("UG"); + public static readonly Country Us = new("US"); public static readonly Country Uy = new("UY"); + public static readonly Country Uz = new("UZ"); + public static readonly Country Ve = new("VE"); public static readonly Country Vn = new("VN"); public static readonly Country Za = new("ZA"); + public static readonly Country Zm = new("ZM"); + + public static readonly Country Zw = new("ZW"); + readonly string _value = value; public enum 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, @@ -209,18 +294,27 @@ public enum Value 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, @@ -235,16 +329,24 @@ public enum Value Sg, Si, Sk, + Sn, + Sr, Sv, Th, + Tj, Tr, Tw, + Tz, Ua, + Ug, Us, Uy, + Uz, Ve, Vn, Za, + Zm, + Zw, } public Value Known() => @@ -252,34 +354,51 @@ public Value Known() => { "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, @@ -292,18 +411,27 @@ public Value Known() => "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, @@ -318,16 +446,24 @@ public Value Known() => "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, _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), }; diff --git a/src/Orb/Models/CustomerTaxIDProperties/Type.cs b/src/Orb/Models/CustomerTaxIDProperties/Type.cs index 661d989d0..ac5011c52 100644 --- a/src/Orb/Models/CustomerTaxIDProperties/Type.cs +++ b/src/Orb/Models/CustomerTaxIDProperties/Type.cs @@ -11,6 +11,12 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type AeTrn = new("ae_trn"); + public static readonly Type AlTin = new("al_tin"); + + public static readonly Type AmTin = new("am_tin"); + + public static readonly Type AoTin = new("ao_tin"); + public static readonly Type ArCuit = new("ar_cuit"); public static readonly Type EuVat = new("eu_vat"); @@ -19,16 +25,34 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type AuArn = new("au_arn"); + public static readonly Type AwTin = new("aw_tin"); + + public static readonly Type AzTin = new("az_tin"); + + public static readonly Type BaTin = new("ba_tin"); + + public static readonly Type BbTin = new("bb_tin"); + + public static readonly Type BdBin = new("bd_bin"); + + public static readonly Type BfIfu = new("bf_ifu"); + public static readonly Type BgUic = new("bg_uic"); public static readonly Type BhVat = new("bh_vat"); + public static readonly Type BjIfu = new("bj_ifu"); + public static readonly Type BoTin = new("bo_tin"); public static readonly Type BrCnpj = new("br_cnpj"); public static readonly Type BrCpf = new("br_cpf"); + public static readonly Type BsTin = new("bs_tin"); + + public static readonly Type ByTin = new("by_tin"); + public static readonly Type CaBn = new("ca_bn"); public static readonly Type CaGstHst = new("ca_gst_hst"); @@ -41,16 +65,26 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type CaQst = new("ca_qst"); + public static readonly Type CdNif = new("cd_nif"); + + public static readonly Type ChUid = new("ch_uid"); + public static readonly Type ChVat = new("ch_vat"); public static readonly Type ClTin = new("cl_tin"); + public static readonly Type CmNiu = new("cm_niu"); + public static readonly Type CnTin = new("cn_tin"); public static readonly Type CoNit = new("co_nit"); public static readonly Type CrTin = new("cr_tin"); + public static readonly Type CvNif = new("cv_nif"); + + public static readonly Type DeStn = new("de_stn"); + public static readonly Type DoRcn = new("do_rcn"); public static readonly Type EcRuc = new("ec_ruc"); @@ -59,14 +93,20 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type EsCif = new("es_cif"); + public static readonly Type EtTin = new("et_tin"); + public static readonly Type EuOssVat = new("eu_oss_vat"); public static readonly Type GBVat = new("gb_vat"); public static readonly Type GeVat = new("ge_vat"); + public static readonly Type GnNif = new("gn_nif"); + public static readonly Type HkBr = new("hk_br"); + public static readonly Type HrOib = new("hr_oib"); + public static readonly Type HuTin = new("hu_tin"); public static readonly Type IDNpwp = new("id_npwp"); @@ -85,12 +125,30 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type KePin = new("ke_pin"); + public static readonly Type KgTin = new("kg_tin"); + + public static readonly Type KhTin = new("kh_tin"); + public static readonly Type KrBrn = new("kr_brn"); public static readonly Type KzBin = new("kz_bin"); + public static readonly Type LaTin = new("la_tin"); + public static readonly Type LiUid = new("li_uid"); + public static readonly Type LiVat = new("li_vat"); + + public static readonly Type MaVat = new("ma_vat"); + + public static readonly Type MdVat = new("md_vat"); + + public static readonly Type MePib = new("me_pib"); + + public static readonly Type MkVat = new("mk_vat"); + + public static readonly Type MrNif = new("mr_nif"); + public static readonly Type MxRfc = new("mx_rfc"); public static readonly Type MyFrp = new("my_frp"); @@ -105,6 +163,8 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type NoVoec = new("no_voec"); + public static readonly Type NpPan = new("np_pan"); + public static readonly Type NzGst = new("nz_gst"); public static readonly Type OmVat = new("om_vat"); @@ -129,60 +189,98 @@ public sealed record class Type(string value) : Orb::IEnum public static readonly Type SiTin = new("si_tin"); + public static readonly Type SnNinea = new("sn_ninea"); + + public static readonly Type SrFin = new("sr_fin"); + public static readonly Type SvNit = new("sv_nit"); public static readonly Type ThVat = new("th_vat"); + public static readonly Type TjTin = new("tj_tin"); + public static readonly Type TrTin = new("tr_tin"); public static readonly Type TwVat = new("tw_vat"); + public static readonly Type TzVat = new("tz_vat"); + public static readonly Type UaVat = new("ua_vat"); + public static readonly Type UgTin = new("ug_tin"); + public static readonly Type UsEin = new("us_ein"); public static readonly Type UyRuc = new("uy_ruc"); + public static readonly Type UzTin = new("uz_tin"); + + public static readonly Type UzVat = new("uz_vat"); + public static readonly Type VeRif = new("ve_rif"); public static readonly Type VnTin = new("vn_tin"); public static readonly Type ZaVat = new("za_vat"); + public static readonly Type ZmTin = new("zm_tin"); + + public static readonly Type ZwTin = new("zw_tin"); + readonly string _value = value; public enum Value { AdNrt, AeTrn, + AlTin, + AmTin, + AoTin, ArCuit, EuVat, AuAbn, AuArn, + AwTin, + AzTin, + BaTin, + BbTin, + BdBin, + BfIfu, BgUic, BhVat, + BjIfu, BoTin, BrCnpj, BrCpf, + BsTin, + ByTin, CaBn, CaGstHst, CaPstBc, CaPstMB, CaPstSk, CaQst, + CdNif, + ChUid, ChVat, ClTin, + CmNiu, CnTin, CoNit, CrTin, + CvNif, + DeStn, DoRcn, EcRuc, EgTin, EsCif, + EtTin, EuOssVat, GBVat, GeVat, + GnNif, HkBr, + HrOib, HuTin, IDNpwp, IlVat, @@ -192,9 +290,18 @@ public enum Value JpRn, JpTrn, KePin, + KgTin, + KhTin, KrBrn, KzBin, + LaTin, LiUid, + LiVat, + MaVat, + MdVat, + MePib, + MkVat, + MrNif, MxRfc, MyFrp, MyItn, @@ -202,6 +309,7 @@ public enum Value NgTin, NoVat, NoVoec, + NpPan, NzGst, OmVat, PeRuc, @@ -214,16 +322,25 @@ public enum Value SgGst, SgUen, SiTin, + SnNinea, + SrFin, SvNit, ThVat, + TjTin, TrTin, TwVat, + TzVat, UaVat, + UgTin, UsEin, UyRuc, + UzTin, + UzVat, VeRif, VnTin, ZaVat, + ZmTin, + ZwTin, } public Value Known() => @@ -231,34 +348,54 @@ public Value Known() => { "ad_nrt" => Value.AdNrt, "ae_trn" => Value.AeTrn, + "al_tin" => Value.AlTin, + "am_tin" => Value.AmTin, + "ao_tin" => Value.AoTin, "ar_cuit" => Value.ArCuit, "eu_vat" => Value.EuVat, "au_abn" => Value.AuAbn, "au_arn" => Value.AuArn, + "aw_tin" => Value.AwTin, + "az_tin" => Value.AzTin, + "ba_tin" => Value.BaTin, + "bb_tin" => Value.BbTin, + "bd_bin" => Value.BdBin, + "bf_ifu" => Value.BfIfu, "bg_uic" => Value.BgUic, "bh_vat" => Value.BhVat, + "bj_ifu" => Value.BjIfu, "bo_tin" => Value.BoTin, "br_cnpj" => Value.BrCnpj, "br_cpf" => Value.BrCpf, + "bs_tin" => Value.BsTin, + "by_tin" => Value.ByTin, "ca_bn" => Value.CaBn, "ca_gst_hst" => Value.CaGstHst, "ca_pst_bc" => Value.CaPstBc, "ca_pst_mb" => Value.CaPstMB, "ca_pst_sk" => Value.CaPstSk, "ca_qst" => Value.CaQst, + "cd_nif" => Value.CdNif, + "ch_uid" => Value.ChUid, "ch_vat" => Value.ChVat, "cl_tin" => Value.ClTin, + "cm_niu" => Value.CmNiu, "cn_tin" => Value.CnTin, "co_nit" => Value.CoNit, "cr_tin" => Value.CrTin, + "cv_nif" => Value.CvNif, + "de_stn" => Value.DeStn, "do_rcn" => Value.DoRcn, "ec_ruc" => Value.EcRuc, "eg_tin" => Value.EgTin, "es_cif" => Value.EsCif, + "et_tin" => Value.EtTin, "eu_oss_vat" => Value.EuOssVat, "gb_vat" => Value.GBVat, "ge_vat" => Value.GeVat, + "gn_nif" => Value.GnNif, "hk_br" => Value.HkBr, + "hr_oib" => Value.HrOib, "hu_tin" => Value.HuTin, "id_npwp" => Value.IDNpwp, "il_vat" => Value.IlVat, @@ -268,9 +405,18 @@ public Value Known() => "jp_rn" => Value.JpRn, "jp_trn" => Value.JpTrn, "ke_pin" => Value.KePin, + "kg_tin" => Value.KgTin, + "kh_tin" => Value.KhTin, "kr_brn" => Value.KrBrn, "kz_bin" => Value.KzBin, + "la_tin" => Value.LaTin, "li_uid" => Value.LiUid, + "li_vat" => Value.LiVat, + "ma_vat" => Value.MaVat, + "md_vat" => Value.MdVat, + "me_pib" => Value.MePib, + "mk_vat" => Value.MkVat, + "mr_nif" => Value.MrNif, "mx_rfc" => Value.MxRfc, "my_frp" => Value.MyFrp, "my_itn" => Value.MyItn, @@ -278,6 +424,7 @@ public Value Known() => "ng_tin" => Value.NgTin, "no_vat" => Value.NoVat, "no_voec" => Value.NoVoec, + "np_pan" => Value.NpPan, "nz_gst" => Value.NzGst, "om_vat" => Value.OmVat, "pe_ruc" => Value.PeRuc, @@ -290,16 +437,25 @@ public Value Known() => "sg_gst" => Value.SgGst, "sg_uen" => Value.SgUen, "si_tin" => Value.SiTin, + "sn_ninea" => Value.SnNinea, + "sr_fin" => Value.SrFin, "sv_nit" => Value.SvNit, "th_vat" => Value.ThVat, + "tj_tin" => Value.TjTin, "tr_tin" => Value.TrTin, "tw_vat" => Value.TwVat, + "tz_vat" => Value.TzVat, "ua_vat" => Value.UaVat, + "ug_tin" => Value.UgTin, "us_ein" => Value.UsEin, "uy_ruc" => Value.UyRuc, + "uz_tin" => Value.UzTin, + "uz_vat" => Value.UzVat, "ve_rif" => Value.VeRif, "vn_tin" => Value.VnTin, "za_vat" => Value.ZaVat, + "zm_tin" => Value.ZmTin, + "zw_tin" => Value.ZwTin, _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), }; diff --git a/src/Orb/Models/Customers/Customer.cs b/src/Orb/Models/Customers/Customer.cs index d9c71b390..7da3cdcb5 100644 --- a/src/Orb/Models/Customers/Customer.cs +++ b/src/Orb/Models/Customers/Customer.cs @@ -362,111 +362,102 @@ public required string? PortalURL /// /// ### 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 | /// public required Models::CustomerTaxID? TaxID { diff --git a/src/Orb/Models/Customers/CustomerCreateParams.cs b/src/Orb/Models/Customers/CustomerCreateParams.cs index 79f899fb5..287b0cf6e 100644 --- a/src/Orb/Models/Customers/CustomerCreateParams.cs +++ b/src/Orb/Models/Customers/CustomerCreateParams.cs @@ -340,111 +340,102 @@ public AddressInput? ShippingAddress /// /// ### 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 | /// public Models::CustomerTaxID? TaxID { diff --git a/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs index 3e2a79d30..000cd5fea 100644 --- a/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs +++ b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs @@ -337,111 +337,102 @@ public AddressInput? ShippingAddress /// /// ### 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 | /// public Models::CustomerTaxID? TaxID { diff --git a/src/Orb/Models/Customers/CustomerUpdateParams.cs b/src/Orb/Models/Customers/CustomerUpdateParams.cs index 410645809..d3436476b 100644 --- a/src/Orb/Models/Customers/CustomerUpdateParams.cs +++ b/src/Orb/Models/Customers/CustomerUpdateParams.cs @@ -338,111 +338,102 @@ public AddressInput? ShippingAddress /// /// ### 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 | /// public Models::CustomerTaxID? TaxID { diff --git a/src/Orb/Models/DimensionalPriceGroups/DimensionalPriceGroupUpdateParams.cs b/src/Orb/Models/DimensionalPriceGroups/DimensionalPriceGroupUpdateParams.cs new file mode 100644 index 000000000..b432d20ab --- /dev/null +++ b/src/Orb/Models/DimensionalPriceGroups/DimensionalPriceGroupUpdateParams.cs @@ -0,0 +1,92 @@ +using Generic = System.Collections.Generic; +using Http = System.Net.Http; +using Json = System.Text.Json; +using Orb = Orb; +using System = System; +using Text = System.Text; + +namespace Orb.Models.DimensionalPriceGroups; + +/// +/// 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. +/// +public sealed record class DimensionalPriceGroupUpdateParams : Orb::ParamsBase +{ + public Generic::Dictionary BodyProperties { get; set; } = []; + + public required string 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. + /// + public string? ExternalDimensionalPriceGroupID + { + get + { + if ( + !this.BodyProperties.TryGetValue( + "external_dimensional_price_group_id", + out Json::JsonElement element + ) + ) + return null; + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.BodyProperties["external_dimensional_price_group_id"] = + Json::JsonSerializer.SerializeToElement(value); + } + } + + /// + /// User-specified key/value 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`. + /// + public Generic::Dictionary? Metadata + { + get + { + if (!this.BodyProperties.TryGetValue("metadata", out Json::JsonElement element)) + return null; + + return Json::JsonSerializer.Deserialize?>(element); + } + set { this.BodyProperties["metadata"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public override System::Uri Url(Orb::IOrbClient client) + { + return new System::UriBuilder( + client.BaseUrl.ToString().TrimEnd('/') + + string.Format("/dimensional_price_groups/{0}", this.DimensionalPriceGroupID) + ) + { + Query = this.QueryString(client), + }.Uri; + } + + public Http::StringContent BodyContent() + { + return new Http::StringContent( + Json::JsonSerializer.Serialize(this.BodyProperties), + Text::Encoding.UTF8, + "application/json" + ); + } + + public void AddHeadersToRequest(Http::HttpRequestMessage request, Orb::IOrbClient client) + { + Orb::ParamsBase.AddDefaultHeaders(request, client); + foreach (var item in this.HeaderProperties) + { + Orb::ParamsBase.AddHeaderElementToRequest(request, item.Key, item.Value); + } + } +} diff --git a/src/Orb/Models/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDUpdateParams.cs b/src/Orb/Models/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDUpdateParams.cs new file mode 100644 index 000000000..f1b3ed739 --- /dev/null +++ b/src/Orb/Models/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDUpdateParams.cs @@ -0,0 +1,95 @@ +using Generic = System.Collections.Generic; +using Http = System.Net.Http; +using Json = System.Text.Json; +using Orb = Orb; +using System = System; +using Text = System.Text; + +namespace Orb.Models.DimensionalPriceGroups.ExternalDimensionalPriceGroupID; + +/// +/// 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. +/// +public sealed record class ExternalDimensionalPriceGroupIDUpdateParams : Orb::ParamsBase +{ + public Generic::Dictionary BodyProperties { get; set; } = []; + + public required string ExternalDimensionalPriceGroupID; + + /// + /// 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. + /// + public string? ExternalDimensionalPriceGroupID1 + { + get + { + if ( + !this.BodyProperties.TryGetValue( + "external_dimensional_price_group_id", + out Json::JsonElement element + ) + ) + return null; + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.BodyProperties["external_dimensional_price_group_id"] = + Json::JsonSerializer.SerializeToElement(value); + } + } + + /// + /// User-specified key/value 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`. + /// + public Generic::Dictionary? Metadata + { + get + { + if (!this.BodyProperties.TryGetValue("metadata", out Json::JsonElement element)) + return null; + + return Json::JsonSerializer.Deserialize?>(element); + } + set { this.BodyProperties["metadata"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public override System::Uri Url(Orb::IOrbClient client) + { + return new System::UriBuilder( + client.BaseUrl.ToString().TrimEnd('/') + + string.Format( + "/dimensional_price_groups/external_dimensional_price_group_id/{0}", + this.ExternalDimensionalPriceGroupID + ) + ) + { + Query = this.QueryString(client), + }.Uri; + } + + public Http::StringContent BodyContent() + { + return new Http::StringContent( + Json::JsonSerializer.Serialize(this.BodyProperties), + Text::Encoding.UTF8, + "application/json" + ); + } + + public void AddHeadersToRequest(Http::HttpRequestMessage request, Orb::IOrbClient client) + { + Orb::ParamsBase.AddDefaultHeaders(request, client); + foreach (var item in this.HeaderProperties) + { + Orb::ParamsBase.AddHeaderElementToRequest(request, item.Key, item.Value); + } + } +} diff --git a/src/Orb/Models/Invoice.cs b/src/Orb/Models/Invoice.cs index e03394731..48483747b 100644 --- a/src/Orb/Models/Invoice.cs +++ b/src/Orb/Models/Invoice.cs @@ -187,111 +187,102 @@ public required CustomerMinified Customer /// /// ### 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 | /// public required CustomerTaxID? CustomerTaxID { diff --git a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponse.cs b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponse.cs index af6e54a50..f75154746 100644 --- a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponse.cs +++ b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponse.cs @@ -184,111 +184,102 @@ public required string Currency /// /// ### 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 | /// public required Models::CustomerTaxID? CustomerTaxID { diff --git a/src/Orb/Models/Price.cs b/src/Orb/Models/Price.cs index c70602d8a..046cca688 100644 --- a/src/Orb/Models/Price.cs +++ b/src/Orb/Models/Price.cs @@ -114,5 +114,9 @@ internal Price() { } PriceProperties::CumulativeGroupedBulk value ) => new(value); + public static PriceVariants::GroupedWithMinMaxThresholds Create( + PriceProperties::GroupedWithMinMaxThresholds value + ) => new(value); + public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs new file mode 100644 index 000000000..c094eb3e5 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs @@ -0,0 +1,541 @@ +using CodeAnalysis = System.Diagnostics.CodeAnalysis; +using Generic = System.Collections.Generic; +using GroupedWithMinMaxThresholdsProperties = Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; +using Json = System.Text.Json; +using Models = Orb.Models; +using Orb = Orb; +using Serialization = System.Text.Json.Serialization; +using System = System; + +namespace Orb.Models.PriceProperties; + +[Serialization::JsonConverter(typeof(Orb::ModelConverter))] +public sealed record class GroupedWithMinMaxThresholds + : Orb::ModelBase, + Orb::IFromRaw +{ + public required string ID + { + get + { + if (!this.Properties.TryGetValue("id", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException("id", "Missing required argument"); + + return Json::JsonSerializer.Deserialize(element) + ?? throw new System::ArgumentNullException("id"); + } + set { this.Properties["id"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required Models::BillableMetricTiny? BillableMetric + { + get + { + if (!this.Properties.TryGetValue("billable_metric", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "billable_metric", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["billable_metric"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required Models::BillingCycleConfiguration BillingCycleConfiguration + { + get + { + if ( + !this.Properties.TryGetValue( + "billing_cycle_configuration", + out Json::JsonElement element + ) + ) + throw new System::ArgumentOutOfRangeException( + "billing_cycle_configuration", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element) + ?? throw new System::ArgumentNullException("billing_cycle_configuration"); + } + set + { + this.Properties["billing_cycle_configuration"] = + Json::JsonSerializer.SerializeToElement(value); + } + } + + public required GroupedWithMinMaxThresholdsProperties::Cadence Cadence + { + get + { + if (!this.Properties.TryGetValue("cadence", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "cadence", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize( + element + ) ?? throw new System::ArgumentNullException("cadence"); + } + set { this.Properties["cadence"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required double? ConversionRate + { + get + { + if (!this.Properties.TryGetValue("conversion_rate", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "conversion_rate", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["conversion_rate"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required GroupedWithMinMaxThresholdsProperties::ConversionRateConfig? ConversionRateConfig + { + get + { + if ( + !this.Properties.TryGetValue( + "conversion_rate_config", + out Json::JsonElement element + ) + ) + throw new System::ArgumentOutOfRangeException( + "conversion_rate_config", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize( + element + ); + } + set + { + this.Properties["conversion_rate_config"] = Json::JsonSerializer.SerializeToElement( + value + ); + } + } + + public required System::DateTime CreatedAt + { + get + { + if (!this.Properties.TryGetValue("created_at", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "created_at", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["created_at"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required Models::Allocation? CreditAllocation + { + get + { + if (!this.Properties.TryGetValue("credit_allocation", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "credit_allocation", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.Properties["credit_allocation"] = Json::JsonSerializer.SerializeToElement(value); + } + } + + public required string Currency + { + get + { + if (!this.Properties.TryGetValue("currency", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "currency", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element) + ?? throw new System::ArgumentNullException("currency"); + } + set { this.Properties["currency"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required Models::Discount? Discount + { + get + { + if (!this.Properties.TryGetValue("discount", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "discount", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["discount"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required string? ExternalPriceID + { + get + { + if (!this.Properties.TryGetValue("external_price_id", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "external_price_id", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.Properties["external_price_id"] = Json::JsonSerializer.SerializeToElement(value); + } + } + + public required double? FixedPriceQuantity + { + get + { + if (!this.Properties.TryGetValue("fixed_price_quantity", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "fixed_price_quantity", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.Properties["fixed_price_quantity"] = Json::JsonSerializer.SerializeToElement( + value + ); + } + } + + public required Generic::Dictionary GroupedWithMinMaxThresholdsConfig + { + get + { + if ( + !this.Properties.TryGetValue( + "grouped_with_min_max_thresholds_config", + out Json::JsonElement element + ) + ) + throw new System::ArgumentOutOfRangeException( + "grouped_with_min_max_thresholds_config", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize>( + element + ) + ?? throw new System::ArgumentNullException( + "grouped_with_min_max_thresholds_config" + ); + } + set + { + this.Properties["grouped_with_min_max_thresholds_config"] = + Json::JsonSerializer.SerializeToElement(value); + } + } + + public required Models::BillingCycleConfiguration? InvoicingCycleConfiguration + { + get + { + if ( + !this.Properties.TryGetValue( + "invoicing_cycle_configuration", + out Json::JsonElement element + ) + ) + throw new System::ArgumentOutOfRangeException( + "invoicing_cycle_configuration", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.Properties["invoicing_cycle_configuration"] = + Json::JsonSerializer.SerializeToElement(value); + } + } + + public required Models::ItemSlim Item + { + get + { + if (!this.Properties.TryGetValue("item", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException("item", "Missing required argument"); + + return Json::JsonSerializer.Deserialize(element) + ?? throw new System::ArgumentNullException("item"); + } + set { this.Properties["item"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required Models::Maximum? Maximum + { + get + { + if (!this.Properties.TryGetValue("maximum", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "maximum", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["maximum"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required string? MaximumAmount + { + get + { + if (!this.Properties.TryGetValue("maximum_amount", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "maximum_amount", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["maximum_amount"] = Json::JsonSerializer.SerializeToElement(value); } + } + + /// + /// 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`. + /// + public required Generic::Dictionary Metadata + { + get + { + if (!this.Properties.TryGetValue("metadata", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "metadata", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize>(element) + ?? throw new System::ArgumentNullException("metadata"); + } + set { this.Properties["metadata"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required Models::Minimum? Minimum + { + get + { + if (!this.Properties.TryGetValue("minimum", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "minimum", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["minimum"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required string? MinimumAmount + { + get + { + if (!this.Properties.TryGetValue("minimum_amount", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "minimum_amount", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required GroupedWithMinMaxThresholdsProperties::ModelType ModelType + { + get + { + if (!this.Properties.TryGetValue("model_type", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "model_type", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize( + element + ) ?? throw new System::ArgumentNullException("model_type"); + } + set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required string Name + { + get + { + if (!this.Properties.TryGetValue("name", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException("name", "Missing required argument"); + + return Json::JsonSerializer.Deserialize(element) + ?? throw new System::ArgumentNullException("name"); + } + set { this.Properties["name"] = Json::JsonSerializer.SerializeToElement(value); } + } + + public required long? PlanPhaseOrder + { + get + { + if (!this.Properties.TryGetValue("plan_phase_order", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "plan_phase_order", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.Properties["plan_phase_order"] = Json::JsonSerializer.SerializeToElement(value); + } + } + + public required GroupedWithMinMaxThresholdsProperties::PriceType PriceType + { + get + { + if (!this.Properties.TryGetValue("price_type", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "price_type", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize( + element + ) ?? throw new System::ArgumentNullException("price_type"); + } + set { this.Properties["price_type"] = Json::JsonSerializer.SerializeToElement(value); } + } + + /// + /// The price id this price replaces. This price will take the place of the replaced + /// price in plan version migrations. + /// + public required string? ReplacesPriceID + { + get + { + if (!this.Properties.TryGetValue("replaces_price_id", out Json::JsonElement element)) + throw new System::ArgumentOutOfRangeException( + "replaces_price_id", + "Missing required argument" + ); + + return Json::JsonSerializer.Deserialize(element); + } + set + { + this.Properties["replaces_price_id"] = Json::JsonSerializer.SerializeToElement(value); + } + } + + public Models::DimensionalPriceConfiguration? DimensionalPriceConfiguration + { + get + { + if ( + !this.Properties.TryGetValue( + "dimensional_price_configuration", + out Json::JsonElement element + ) + ) + return null; + + return Json::JsonSerializer.Deserialize( + element + ); + } + set + { + this.Properties["dimensional_price_configuration"] = + Json::JsonSerializer.SerializeToElement(value); + } + } + + public override void Validate() + { + _ = this.ID; + this.BillableMetric?.Validate(); + this.BillingCycleConfiguration.Validate(); + this.Cadence.Validate(); + _ = this.ConversionRate; + this.ConversionRateConfig?.Validate(); + _ = this.CreatedAt; + this.CreditAllocation?.Validate(); + _ = this.Currency; + this.Discount?.Validate(); + _ = this.ExternalPriceID; + _ = this.FixedPriceQuantity; + foreach (var item in this.GroupedWithMinMaxThresholdsConfig.Values) + { + _ = item; + } + this.InvoicingCycleConfiguration?.Validate(); + this.Item.Validate(); + this.Maximum?.Validate(); + _ = this.MaximumAmount; + foreach (var item in this.Metadata.Values) + { + _ = item; + } + this.Minimum?.Validate(); + _ = this.MinimumAmount; + this.ModelType.Validate(); + _ = this.Name; + _ = this.PlanPhaseOrder; + this.PriceType.Validate(); + _ = this.ReplacesPriceID; + this.DimensionalPriceConfiguration?.Validate(); + } + + public GroupedWithMinMaxThresholds() { } + +#pragma warning disable CS8618 + [CodeAnalysis::SetsRequiredMembers] + GroupedWithMinMaxThresholds(Generic::Dictionary properties) + { + Properties = properties; + } +#pragma warning restore CS8618 + + public static GroupedWithMinMaxThresholds FromRawUnchecked( + Generic::Dictionary properties + ) + { + return new(properties); + } +} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/Cadence.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/Cadence.cs new file mode 100644 index 000000000..579322222 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/Cadence.cs @@ -0,0 +1,60 @@ +using Orb = Orb; +using Serialization = System.Text.Json.Serialization; +using System = System; + +namespace Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; + +[Serialization::JsonConverter(typeof(Orb::EnumConverter))] +public sealed record class Cadence(string value) : Orb::IEnum +{ + public static readonly Cadence OneTime = new("one_time"); + + public static readonly Cadence Monthly = new("monthly"); + + public static readonly Cadence Quarterly = new("quarterly"); + + public static readonly Cadence SemiAnnual = new("semi_annual"); + + public static readonly Cadence Annual = new("annual"); + + public static readonly Cadence Custom = new("custom"); + + readonly string _value = value; + + public enum Value + { + OneTime, + Monthly, + Quarterly, + SemiAnnual, + Annual, + Custom, + } + + public Value Known() => + _value switch + { + "one_time" => Value.OneTime, + "monthly" => Value.Monthly, + "quarterly" => Value.Quarterly, + "semi_annual" => Value.SemiAnnual, + "annual" => Value.Annual, + "custom" => Value.Custom, + _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), + }; + + public string Raw() + { + return _value; + } + + public void Validate() + { + Known(); + } + + public static Cadence FromRaw(string value) + { + return new(value); + } +} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs new file mode 100644 index 000000000..e0696be82 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs @@ -0,0 +1,22 @@ +using ConversionRateConfigVariants = Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties.ConversionRateConfigVariants; +using Models = Orb.Models; +using Orb = Orb; +using Serialization = System.Text.Json.Serialization; + +namespace Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; + +[Serialization::JsonConverter(typeof(Orb::UnionConverter))] +public abstract record class ConversionRateConfig +{ + internal ConversionRateConfig() { } + + public static ConversionRateConfigVariants::UnitConversionRateConfig Create( + Models::UnitConversionRateConfig value + ) => new(value); + + public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + Models::TieredConversionRateConfig value + ) => new(value); + + public abstract void Validate(); +} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfigVariants/All.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfigVariants/All.cs new file mode 100644 index 000000000..efa33a8a3 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfigVariants/All.cs @@ -0,0 +1,42 @@ +using GroupedWithMinMaxThresholdsProperties = Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; +using Models = Orb.Models; +using Orb = Orb; +using Serialization = System.Text.Json.Serialization; + +namespace Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties.ConversionRateConfigVariants; + +[Serialization::JsonConverter( + typeof(Orb::VariantConverter) +)] +public sealed record class UnitConversionRateConfig(Models::UnitConversionRateConfig Value) + : GroupedWithMinMaxThresholdsProperties::ConversionRateConfig, + Orb::IVariant +{ + public static UnitConversionRateConfig From(Models::UnitConversionRateConfig value) + { + return new(value); + } + + public override void Validate() + { + this.Value.Validate(); + } +} + +[Serialization::JsonConverter( + typeof(Orb::VariantConverter) +)] +public sealed record class TieredConversionRateConfig(Models::TieredConversionRateConfig Value) + : GroupedWithMinMaxThresholdsProperties::ConversionRateConfig, + Orb::IVariant +{ + public static TieredConversionRateConfig From(Models::TieredConversionRateConfig value) + { + return new(value); + } + + public override void Validate() + { + this.Value.Validate(); + } +} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs new file mode 100644 index 000000000..f637956e0 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs @@ -0,0 +1,42 @@ +using Orb = Orb; +using Serialization = System.Text.Json.Serialization; +using System = System; + +namespace Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; + +[Serialization::JsonConverter(typeof(Orb::EnumConverter))] +public sealed record class ModelType(string value) : Orb::IEnum +{ + public static readonly ModelType GroupedWithMinMaxThresholds = new( + "grouped_with_min_max_thresholds" + ); + + readonly string _value = value; + + public enum Value + { + GroupedWithMinMaxThresholds, + } + + public Value Known() => + _value switch + { + "grouped_with_min_max_thresholds" => Value.GroupedWithMinMaxThresholds, + _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), + }; + + public string Raw() + { + return _value; + } + + public void Validate() + { + Known(); + } + + public static ModelType FromRaw(string value) + { + return new(value); + } +} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/PriceType.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/PriceType.cs new file mode 100644 index 000000000..14b6142e4 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/PriceType.cs @@ -0,0 +1,44 @@ +using Orb = Orb; +using Serialization = System.Text.Json.Serialization; +using System = System; + +namespace Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; + +[Serialization::JsonConverter(typeof(Orb::EnumConverter))] +public sealed record class PriceType(string value) : Orb::IEnum +{ + public static readonly PriceType UsagePrice = new("usage_price"); + + public static readonly PriceType FixedPrice = new("fixed_price"); + + readonly string _value = value; + + public enum Value + { + UsagePrice, + FixedPrice, + } + + public Value Known() => + _value switch + { + "usage_price" => Value.UsagePrice, + "fixed_price" => Value.FixedPrice, + _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), + }; + + public string Raw() + { + return _value; + } + + public void Validate() + { + Known(); + } + + public static PriceType FromRaw(string value) + { + return new(value); + } +} diff --git a/src/Orb/Models/PriceVariants/All.cs b/src/Orb/Models/PriceVariants/All.cs index 0e04b6797..7bd311a0c 100644 --- a/src/Orb/Models/PriceVariants/All.cs +++ b/src/Orb/Models/PriceVariants/All.cs @@ -522,3 +522,28 @@ public override void Validate() this.Value.Validate(); } } + +[Serialization::JsonConverter( + typeof(Orb::VariantConverter< + GroupedWithMinMaxThresholds, + PriceProperties::GroupedWithMinMaxThresholds + >) +)] +public sealed record class GroupedWithMinMaxThresholds( + PriceProperties::GroupedWithMinMaxThresholds Value +) + : Models::Price, + Orb::IVariant +{ + public static GroupedWithMinMaxThresholds From( + PriceProperties::GroupedWithMinMaxThresholds value + ) + { + return new(value); + } + + public override void Validate() + { + this.Value.Validate(); + } +} diff --git a/src/Orb/Service/DimensionalPriceGroups/DimensionalPriceGroupService.cs b/src/Orb/Service/DimensionalPriceGroups/DimensionalPriceGroupService.cs index 96ef3a076..2ed92ac61 100644 --- a/src/Orb/Service/DimensionalPriceGroups/DimensionalPriceGroupService.cs +++ b/src/Orb/Service/DimensionalPriceGroups/DimensionalPriceGroupService.cs @@ -69,6 +69,29 @@ await response.Content.ReadAsStringAsync() ) ?? throw new System::NullReferenceException(); } + public async Tasks::Task Update( + DimensionalPriceGroups::DimensionalPriceGroupUpdateParams @params + ) + { + Http::HttpRequestMessage webRequest = new(Http::HttpMethod.Put, @params.Url(this._client)) + { + Content = @params.BodyContent(), + }; + @params.AddHeadersToRequest(webRequest, this._client); + using Http::HttpResponseMessage response = await _client.HttpClient.SendAsync(webRequest); + try + { + response.EnsureSuccessStatusCode(); + } + catch (Http::HttpRequestException e) + { + throw new Orb::HttpException(e.StatusCode, await response.Content.ReadAsStringAsync()); + } + return Json::JsonSerializer.Deserialize( + await response.Content.ReadAsStringAsync() + ) ?? throw new System::NullReferenceException(); + } + public async Tasks::Task List( DimensionalPriceGroups::DimensionalPriceGroupListParams @params ) diff --git a/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDService.cs b/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDService.cs index 1698f482d..fc02d86dc 100644 --- a/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDService.cs +++ b/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/ExternalDimensionalPriceGroupIDService.cs @@ -36,4 +36,27 @@ public ExternalDimensionalPriceGroupIDService(Orb::IOrbClient client) await response.Content.ReadAsStringAsync() ) ?? throw new System::NullReferenceException(); } + + public async Tasks::Task Update( + ExternalDimensionalPriceGroupID::ExternalDimensionalPriceGroupIDUpdateParams @params + ) + { + Http::HttpRequestMessage webRequest = new(Http::HttpMethod.Put, @params.Url(this._client)) + { + Content = @params.BodyContent(), + }; + @params.AddHeadersToRequest(webRequest, this._client); + using Http::HttpResponseMessage response = await _client.HttpClient.SendAsync(webRequest); + try + { + response.EnsureSuccessStatusCode(); + } + catch (Http::HttpRequestException e) + { + throw new Orb::HttpException(e.StatusCode, await response.Content.ReadAsStringAsync()); + } + return Json::JsonSerializer.Deserialize( + await response.Content.ReadAsStringAsync() + ) ?? throw new System::NullReferenceException(); + } } diff --git a/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/IExternalDimensionalPriceGroupIDService.cs b/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/IExternalDimensionalPriceGroupIDService.cs index c7f3740a7..64bbcdef5 100644 --- a/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/IExternalDimensionalPriceGroupIDService.cs +++ b/src/Orb/Service/DimensionalPriceGroups/ExternalDimensionalPriceGroupID/IExternalDimensionalPriceGroupIDService.cs @@ -12,4 +12,13 @@ public interface IExternalDimensionalPriceGroupIDService Tasks::Task Retrieve( ExternalDimensionalPriceGroupID::ExternalDimensionalPriceGroupIDRetrieveParams @params ); + + /// + /// 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. + /// + Tasks::Task Update( + ExternalDimensionalPriceGroupID::ExternalDimensionalPriceGroupIDUpdateParams @params + ); } diff --git a/src/Orb/Service/DimensionalPriceGroups/IDimensionalPriceGroupService.cs b/src/Orb/Service/DimensionalPriceGroups/IDimensionalPriceGroupService.cs index 743e6bf5f..7a26b90d6 100644 --- a/src/Orb/Service/DimensionalPriceGroups/IDimensionalPriceGroupService.cs +++ b/src/Orb/Service/DimensionalPriceGroups/IDimensionalPriceGroupService.cs @@ -29,6 +29,15 @@ public interface IDimensionalPriceGroupService DimensionalPriceGroups::DimensionalPriceGroupRetrieveParams @params ); + /// + /// 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. + /// + Tasks::Task Update( + DimensionalPriceGroups::DimensionalPriceGroupUpdateParams @params + ); + /// /// List dimensional price groups /// From 25e678a352492d8119389201e754ffa1b96b85a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 16:04:32 +0000 Subject: [PATCH 07/10] feat(client): automatically set constants for user --- .../Service/Coupons/CouponServiceTest.cs | 7 +--- .../Credits/Ledger/LedgerServiceTest.cs | 2 - .../Subscriptions/SubscriptionServiceTest.cs | 7 +--- .../DiscountProperties/Amount.cs | 20 ++++++--- .../AmountProperties/DiscountType.cs | 40 ------------------ .../DiscountProperties/Percentage.cs | 20 ++++++--- .../PercentageProperties/DiscountType.cs | 40 ------------------ .../BodyProperties/Amendment.cs | 20 ++++++--- .../AmendmentProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Decrement.cs | 20 ++++++--- .../DecrementProperties/EntryType.cs | 40 ------------------ .../BodyProperties/ExpirationChange.cs | 22 +++++++--- .../ExpirationChangeProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Increment.cs | 19 ++++++--- .../IncrementProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Void.cs | 15 ++++--- .../VoidProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Amendment.cs | 20 ++++++--- .../AmendmentProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Decrement.cs | 20 ++++++--- .../DecrementProperties/EntryType.cs | 40 ------------------ .../BodyProperties/ExpirationChange.cs | 22 +++++++--- .../ExpirationChangeProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Increment.cs | 19 ++++++--- .../IncrementProperties/EntryType.cs | 40 ------------------ .../BodyProperties/Void.cs | 15 ++++--- .../VoidProperties/EntryType.cs | 40 ------------------ src/Orb/Models/PriceProperties/BPS.cs | 15 ++++--- .../BPSProperties/ModelType.cs | 40 ------------------ src/Orb/Models/PriceProperties/Bulk.cs | 15 ++++--- src/Orb/Models/PriceProperties/BulkBPS.cs | 19 ++++++--- .../BulkBPSProperties/ModelType.cs | 40 ------------------ .../BulkProperties/ModelType.cs | 40 ------------------ .../PriceProperties/BulkWithProration.cs | 21 +++++++--- .../BulkWithProrationProperties/ModelType.cs | 40 ------------------ .../PriceProperties/CumulativeGroupedBulk.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ .../PriceProperties/GroupedAllocation.cs | 21 +++++++--- .../GroupedAllocationProperties/ModelType.cs | 40 ------------------ .../Models/PriceProperties/GroupedTiered.cs | 19 ++++++--- .../PriceProperties/GroupedTieredPackage.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ .../GroupedTieredProperties/ModelType.cs | 40 ------------------ .../GroupedWithMeteredMinimum.cs | 24 ++++++++--- .../ModelType.cs | 42 ------------------- .../GroupedWithMinMaxThresholds.cs | 24 ++++++++--- .../ModelType.cs | 42 ------------------- .../GroupedWithProratedMinimum.cs | 24 ++++++++--- .../ModelType.cs | 42 ------------------- src/Orb/Models/PriceProperties/Matrix.cs | 19 ++++++--- .../MatrixProperties/ModelType.cs | 40 ------------------ .../PriceProperties/MatrixWithAllocation.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ .../PriceProperties/MatrixWithDisplayName.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ .../PriceProperties/MaxGroupTieredPackage.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ src/Orb/Models/PriceProperties/Package.cs | 19 ++++++--- .../PackageProperties/ModelType.cs | 40 ------------------ .../PriceProperties/PackageWithAllocation.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ .../ScalableMatrixWithTieredPricing.cs | 24 ++++++++--- .../ModelType.cs | 42 ------------------- .../ScalableMatrixWithUnitPricing.cs | 24 ++++++++--- .../ModelType.cs | 42 ------------------- .../PriceProperties/ThresholdTotalAmount.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ src/Orb/Models/PriceProperties/Tiered.cs | 19 ++++++--- src/Orb/Models/PriceProperties/TieredBPS.cs | 19 ++++++--- .../TieredBPSProperties/ModelType.cs | 40 ------------------ .../Models/PriceProperties/TieredPackage.cs | 19 ++++++--- .../TieredPackageProperties/ModelType.cs | 40 ------------------ .../TieredPackageWithMinimum.cs | 24 ++++++++--- .../ModelType.cs | 40 ------------------ .../TieredProperties/ModelType.cs | 40 ------------------ .../PriceProperties/TieredWithMinimum.cs | 21 +++++++--- .../TieredWithMinimumProperties/ModelType.cs | 40 ------------------ .../PriceProperties/TieredWithProration.cs | 22 +++++++--- .../ModelType.cs | 40 ------------------ src/Orb/Models/PriceProperties/Unit.cs | 15 ++++--- .../UnitProperties/ModelType.cs | 40 ------------------ .../Models/PriceProperties/UnitWithPercent.cs | 21 +++++++--- .../UnitWithPercentProperties/ModelType.cs | 40 ------------------ .../PriceProperties/UnitWithProration.cs | 21 +++++++--- .../UnitWithProrationProperties/ModelType.cs | 40 ------------------ .../DiscountProperties/Amount.cs | 20 ++++++--- .../AmountProperties/DiscountType.cs | 40 ------------------ .../DiscountProperties/Percentage.cs | 20 ++++++--- .../PercentageProperties/DiscountType.cs | 40 ------------------ .../AddProperties/DiscountProperties/Usage.cs | 20 ++++++--- .../UsageProperties/DiscountType.cs | 40 ------------------ 91 files changed, 652 insertions(+), 2029 deletions(-) delete mode 100644 src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/AmountProperties/DiscountType.cs delete mode 100644 src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/PercentageProperties/DiscountType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/DecrementProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/VoidProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/DecrementProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/EntryType.cs delete mode 100644 src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/VoidProperties/EntryType.cs delete mode 100644 src/Orb/Models/PriceProperties/BPSProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/BulkBPSProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/BulkProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/BulkWithProrationProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/GroupedAllocationProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/GroupedTieredProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/MatrixProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/PackageProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/TieredBPSProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/TieredPackageProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/TieredProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/TieredWithProrationProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/UnitProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/UnitWithPercentProperties/ModelType.cs delete mode 100644 src/Orb/Models/PriceProperties/UnitWithProrationProperties/ModelType.cs delete mode 100644 src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/AmountProperties/DiscountType.cs delete mode 100644 src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/PercentageProperties/DiscountType.cs delete mode 100644 src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/UsageProperties/DiscountType.cs diff --git a/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs b/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs index 3cd0d0320..c0e5ea8a6 100644 --- a/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs +++ b/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs @@ -1,7 +1,6 @@ using CouponCreateParamsProperties = Orb.Models.Coupons.CouponCreateParamsProperties; using Coupons = Orb.Models.Coupons; using DiscountProperties = Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties; -using PercentageProperties = Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties.PercentageProperties; using Tasks = System.Threading.Tasks; using Tests = Orb.Tests; @@ -16,11 +15,7 @@ public class CouponServiceTest : Tests::TestBase new Coupons::CouponCreateParams() { Discount = CouponCreateParamsProperties::Discount.Create( - new DiscountProperties::Percentage() - { - DiscountType = PercentageProperties::DiscountType.Percentage, - PercentageDiscount = 0, - } + new DiscountProperties::Percentage() { PercentageDiscount = 0 } ), RedemptionCode = "HALFOFF", DurationInMonths = 12, diff --git a/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs b/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs index 3d01de1c3..40a1a0bb0 100644 --- a/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs +++ b/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs @@ -50,7 +50,6 @@ public class LedgerServiceTest : Tests::TestBase new BodyProperties::Increment() { Amount = 0, - EntryType = IncrementProperties::EntryType.Increment, Currency = "currency", Description = "description", EffectiveDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), @@ -85,7 +84,6 @@ public class LedgerServiceTest : Tests::TestBase new BodyProperties1::Increment() { Amount = 0, - EntryType = IncrementProperties1::EntryType.Increment, Currency = "currency", Description = "description", EffectiveDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), diff --git a/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs b/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs index 3c6dffc82..fe1db92f5 100644 --- a/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs +++ b/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs @@ -4,7 +4,6 @@ using AddPriceProperties = Orb.Models.Subscriptions.SubscriptionCreateParamsProperties.AddPriceProperties; using AddPriceProperties1 = Orb.Models.Subscriptions.SubscriptionSchedulePlanChangeParamsProperties.AddPriceProperties; using AddProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties; -using AmountProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.AmountProperties; using CustomExpirationProperties = Orb.Models.CustomExpirationProperties; using DiscountOverrideProperties = Orb.Models.Subscriptions.DiscountOverrideProperties; using DiscountProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties; @@ -493,11 +492,7 @@ public class SubscriptionServiceTest : Tests::TestBase Discounts = [ AddProperties::Discount.Create( - new DiscountProperties::Amount() - { - AmountDiscount = 0, - DiscountType = AmountProperties::DiscountType.Amount, - } + new DiscountProperties::Amount() { AmountDiscount = 0 } ), ], EndDate = AddProperties::EndDate.Create( diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs index 60e4c6ce3..906ace27c 100644 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs +++ b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs @@ -1,4 +1,3 @@ -using AmountProperties = Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties.AmountProperties; using CodeAnalysis = System.Diagnostics.CodeAnalysis; using Generic = System.Collections.Generic; using Json = System.Text.Json; @@ -27,7 +26,7 @@ public required string AmountDiscount set { this.Properties["amount_discount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required AmountProperties::DiscountType DiscountType + public Json::JsonElement DiscountType { get { @@ -37,8 +36,7 @@ public required string AmountDiscount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("discount_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["discount_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -46,10 +44,20 @@ public required string AmountDiscount public override void Validate() { _ = this.AmountDiscount; - this.DiscountType.Validate(); + if ( + !this.DiscountType.Equals( + Json::JsonSerializer.Deserialize("\"amount\"") + ) + ) + { + throw new System::Exception(); + } } - public Amount() { } + public Amount() + { + this.DiscountType = Json::JsonSerializer.Deserialize("\"amount\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/AmountProperties/DiscountType.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/AmountProperties/DiscountType.cs deleted file mode 100644 index 29c8d648f..000000000 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/AmountProperties/DiscountType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties.AmountProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class DiscountType(string value) : Orb::IEnum -{ - public static readonly DiscountType Amount = new("amount"); - - readonly string _value = value; - - public enum Value - { - Amount, - } - - public Value Known() => - _value switch - { - "amount" => Value.Amount, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static DiscountType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs index db1056163..8ba83a1c4 100644 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs +++ b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs @@ -2,7 +2,6 @@ using Generic = System.Collections.Generic; using Json = System.Text.Json; using Orb = Orb; -using PercentageProperties = Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties.PercentageProperties; using Serialization = System.Text.Json.Serialization; using System = System; @@ -11,7 +10,7 @@ namespace Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties; [Serialization::JsonConverter(typeof(Orb::ModelConverter))] public sealed record class Percentage : Orb::ModelBase, Orb::IFromRaw { - public required PercentageProperties::DiscountType DiscountType + public Json::JsonElement DiscountType { get { @@ -21,8 +20,7 @@ public sealed record class Percentage : Orb::ModelBase, Orb::IFromRaw(element) - ?? throw new System::ArgumentNullException("discount_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["discount_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -47,11 +45,21 @@ public required double PercentageDiscount public override void Validate() { - this.DiscountType.Validate(); + if ( + !this.DiscountType.Equals( + Json::JsonSerializer.Deserialize("\"percentage\"") + ) + ) + { + throw new System::Exception(); + } _ = this.PercentageDiscount; } - public Percentage() { } + public Percentage() + { + this.DiscountType = Json::JsonSerializer.Deserialize("\"percentage\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/PercentageProperties/DiscountType.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/PercentageProperties/DiscountType.cs deleted file mode 100644 index fd1a73b21..000000000 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/PercentageProperties/DiscountType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties.PercentageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class DiscountType(string value) : Orb::IEnum -{ - public static readonly DiscountType Percentage = new("percentage"); - - readonly string _value = value; - - public enum Value - { - Percentage, - } - - public Value Known() => - _value switch - { - "percentage" => Value.Percentage, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static DiscountType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs index bf8f4f588..5452c8427 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs @@ -1,4 +1,3 @@ -using AmendmentProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.AmendmentProperties; using CodeAnalysis = System.Diagnostics.CodeAnalysis; using Generic = System.Collections.Generic; using Json = System.Text.Json; @@ -49,7 +48,7 @@ public required string BlockID set { this.Properties["block_id"] = Json::JsonSerializer.SerializeToElement(value); } } - public required AmendmentProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -59,8 +58,7 @@ public required string BlockID "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -119,7 +117,14 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"amendment\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -131,7 +136,10 @@ public override void Validate() } } - public Amendment() { } + public Amendment() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"amendment\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs deleted file mode 100644 index 5d718f374..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.AmendmentProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Amendment = new("amendment"); - - readonly string _value = value; - - public enum Value - { - Amendment, - } - - public Value Known() => - _value switch - { - "amendment" => Value.Amendment, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs index bc5139518..928f39bf8 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs @@ -1,5 +1,4 @@ using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using DecrementProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.DecrementProperties; using Generic = System.Collections.Generic; using Json = System.Text.Json; using Orb = Orb; @@ -30,7 +29,7 @@ public required double Amount set { this.Properties["amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required DecrementProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -40,8 +39,7 @@ public required double Amount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -99,7 +97,14 @@ public string? Description public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"decrement\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -111,7 +116,10 @@ public override void Validate() } } - public Decrement() { } + public Decrement() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"decrement\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/DecrementProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/DecrementProperties/EntryType.cs deleted file mode 100644 index 83266bfb2..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/DecrementProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.DecrementProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Decrement = new("decrement"); - - readonly string _value = value; - - public enum Value - { - Decrement, - } - - public Value Known() => - _value switch - { - "decrement" => Value.Decrement, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs index 29355e607..a5ff0044d 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs @@ -1,5 +1,4 @@ using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using ExpirationChangeProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.ExpirationChangeProperties; using Generic = System.Collections.Generic; using Json = System.Text.Json; using Orb = Orb; @@ -11,7 +10,7 @@ namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParam [Serialization::JsonConverter(typeof(Orb::ModelConverter))] public sealed record class ExpirationChange : Orb::ModelBase, Orb::IFromRaw { - public required ExpirationChangeProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -21,8 +20,7 @@ public sealed record class ExpirationChange : Orb::ModelBase, Orb::IFromRaw(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -148,7 +146,14 @@ public string? Description public override void Validate() { - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"expiration_change\"") + ) + ) + { + throw new System::Exception(); + } _ = this.TargetExpiryDate; _ = this.Amount; _ = this.BlockID; @@ -164,7 +169,12 @@ public override void Validate() } } - public ExpirationChange() { } + public ExpirationChange() + { + this.EntryType = Json::JsonSerializer.Deserialize( + "\"expiration_change\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs deleted file mode 100644 index 7c0399c76..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.ExpirationChangeProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType ExpirationChange = new("expiration_change"); - - readonly string _value = value; - - public enum Value - { - ExpirationChange, - } - - public Value Known() => - _value switch - { - "expiration_change" => Value.ExpirationChange, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs index c759cc5ed..1a9d10424 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs @@ -30,7 +30,7 @@ public required double Amount set { this.Properties["amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required IncrementProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -40,8 +40,7 @@ public required double Amount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -169,7 +168,14 @@ public string? PerUnitCostBasis public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"increment\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; _ = this.EffectiveDate; @@ -185,7 +191,10 @@ public override void Validate() _ = this.PerUnitCostBasis; } - public Increment() { } + public Increment() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"increment\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/EntryType.cs deleted file mode 100644 index 7f047af8c..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.IncrementProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Increment = new("increment"); - - readonly string _value = value; - - public enum Value - { - Increment, - } - - public Value Known() => - _value switch - { - "increment" => Value.Increment, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs index 6f3d1d36b..dd47dbd23 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs @@ -49,7 +49,7 @@ public required string BlockID set { this.Properties["block_id"] = Json::JsonSerializer.SerializeToElement(value); } } - public required VoidProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -59,8 +59,7 @@ public required string BlockID "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -134,7 +133,10 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); + if (!this.EntryType.Equals(Json::JsonSerializer.Deserialize("\"void\""))) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -147,7 +149,10 @@ public override void Validate() this.VoidReason?.Validate(); } - public Void() { } + public Void() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"void\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/VoidProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/VoidProperties/EntryType.cs deleted file mode 100644 index a2868395e..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/VoidProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.VoidProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Void = new("void"); - - readonly string _value = value; - - public enum Value - { - Void, - } - - public Value Known() => - _value switch - { - "void" => Value.Void, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs index 2dd02daeb..a5e1edb57 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs @@ -1,4 +1,3 @@ -using AmendmentProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.AmendmentProperties; using CodeAnalysis = System.Diagnostics.CodeAnalysis; using Generic = System.Collections.Generic; using Json = System.Text.Json; @@ -49,7 +48,7 @@ public required string BlockID set { this.Properties["block_id"] = Json::JsonSerializer.SerializeToElement(value); } } - public required AmendmentProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -59,8 +58,7 @@ public required string BlockID "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -119,7 +117,14 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"amendment\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -131,7 +136,10 @@ public override void Validate() } } - public Amendment() { } + public Amendment() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"amendment\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs deleted file mode 100644 index 9efb1cbf2..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/AmendmentProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.AmendmentProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Amendment = new("amendment"); - - readonly string _value = value; - - public enum Value - { - Amendment, - } - - public Value Known() => - _value switch - { - "amendment" => Value.Amendment, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs index 854e870ac..8f52a0e35 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs @@ -1,5 +1,4 @@ using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using DecrementProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.DecrementProperties; using Generic = System.Collections.Generic; using Json = System.Text.Json; using Orb = Orb; @@ -30,7 +29,7 @@ public required double Amount set { this.Properties["amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required DecrementProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -40,8 +39,7 @@ public required double Amount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -99,7 +97,14 @@ public string? Description public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"decrement\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -111,7 +116,10 @@ public override void Validate() } } - public Decrement() { } + public Decrement() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"decrement\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/DecrementProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/DecrementProperties/EntryType.cs deleted file mode 100644 index a720a3de2..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/DecrementProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.DecrementProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Decrement = new("decrement"); - - readonly string _value = value; - - public enum Value - { - Decrement, - } - - public Value Known() => - _value switch - { - "decrement" => Value.Decrement, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs index b89e3e036..86c5aafe8 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs @@ -1,5 +1,4 @@ using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using ExpirationChangeProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.ExpirationChangeProperties; using Generic = System.Collections.Generic; using Json = System.Text.Json; using Orb = Orb; @@ -11,7 +10,7 @@ namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties. [Serialization::JsonConverter(typeof(Orb::ModelConverter))] public sealed record class ExpirationChange : Orb::ModelBase, Orb::IFromRaw { - public required ExpirationChangeProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -21,8 +20,7 @@ public sealed record class ExpirationChange : Orb::ModelBase, Orb::IFromRaw(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -148,7 +146,14 @@ public string? Description public override void Validate() { - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"expiration_change\"") + ) + ) + { + throw new System::Exception(); + } _ = this.TargetExpiryDate; _ = this.Amount; _ = this.BlockID; @@ -164,7 +169,12 @@ public override void Validate() } } - public ExpirationChange() { } + public ExpirationChange() + { + this.EntryType = Json::JsonSerializer.Deserialize( + "\"expiration_change\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs deleted file mode 100644 index 78e2b0a03..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChangeProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.ExpirationChangeProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType ExpirationChange = new("expiration_change"); - - readonly string _value = value; - - public enum Value - { - ExpirationChange, - } - - public Value Known() => - _value switch - { - "expiration_change" => Value.ExpirationChange, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs index b851597df..a36f06066 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs @@ -30,7 +30,7 @@ public required double Amount set { this.Properties["amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required IncrementProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -40,8 +40,7 @@ public required double Amount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -169,7 +168,14 @@ public string? PerUnitCostBasis public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); + if ( + !this.EntryType.Equals( + Json::JsonSerializer.Deserialize("\"increment\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; _ = this.EffectiveDate; @@ -185,7 +191,10 @@ public override void Validate() _ = this.PerUnitCostBasis; } - public Increment() { } + public Increment() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"increment\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/EntryType.cs deleted file mode 100644 index b7a800c7f..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.IncrementProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Increment = new("increment"); - - readonly string _value = value; - - public enum Value - { - Increment, - } - - public Value Known() => - _value switch - { - "increment" => Value.Increment, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs index 241e839d4..be205169b 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs @@ -49,7 +49,7 @@ public required string BlockID set { this.Properties["block_id"] = Json::JsonSerializer.SerializeToElement(value); } } - public required VoidProperties::EntryType EntryType + public Json::JsonElement EntryType { get { @@ -59,8 +59,7 @@ public required string BlockID "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("entry_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["entry_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -134,7 +133,10 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); + if (!this.EntryType.Equals(Json::JsonSerializer.Deserialize("\"void\""))) + { + throw new System::Exception(); + } _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -147,7 +149,10 @@ public override void Validate() this.VoidReason?.Validate(); } - public Void() { } + public Void() + { + this.EntryType = Json::JsonSerializer.Deserialize("\"void\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/VoidProperties/EntryType.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/VoidProperties/EntryType.cs deleted file mode 100644 index d1cfb7572..000000000 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/VoidProperties/EntryType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.VoidProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class EntryType(string value) : Orb::IEnum -{ - public static readonly EntryType Void = new("void"); - - readonly string _value = value; - - public enum Value - { - Void, - } - - public Value Known() => - _value switch - { - "void" => Value.Void, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static EntryType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/BPS.cs b/src/Orb/Models/PriceProperties/BPS.cs index 9e37cf6a7..856035b5b 100644 --- a/src/Orb/Models/PriceProperties/BPS.cs +++ b/src/Orb/Models/PriceProperties/BPS.cs @@ -358,7 +358,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required BPSProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -368,8 +368,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -491,7 +490,10 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if (!this.ModelType.Equals(Json::JsonSerializer.Deserialize("\"bps\""))) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -499,7 +501,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public BPS() { } + public BPS() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"bps\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/BPSProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BPSProperties/ModelType.cs deleted file mode 100644 index 4b294553e..000000000 --- a/src/Orb/Models/PriceProperties/BPSProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.BPSProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType BPS = new("bps"); - - readonly string _value = value; - - public enum Value - { - BPS, - } - - public Value Known() => - _value switch - { - "bps" => Value.BPS, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/Bulk.cs b/src/Orb/Models/PriceProperties/Bulk.cs index c724cec2c..3c1a23c9f 100644 --- a/src/Orb/Models/PriceProperties/Bulk.cs +++ b/src/Orb/Models/PriceProperties/Bulk.cs @@ -358,7 +358,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required BulkProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -368,8 +368,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -491,7 +490,10 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if (!this.ModelType.Equals(Json::JsonSerializer.Deserialize("\"bulk\""))) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -499,7 +501,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public Bulk() { } + public Bulk() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"bulk\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/BulkBPS.cs b/src/Orb/Models/PriceProperties/BulkBPS.cs index b9ff5f5d0..b1b420a1b 100644 --- a/src/Orb/Models/PriceProperties/BulkBPS.cs +++ b/src/Orb/Models/PriceProperties/BulkBPS.cs @@ -360,7 +360,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required BulkBPSProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -370,8 +370,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -493,7 +492,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"bulk_bps\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -501,7 +507,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public BulkBPS() { } + public BulkBPS() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"bulk_bps\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/BulkBPSProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BulkBPSProperties/ModelType.cs deleted file mode 100644 index 2bdf4cde2..000000000 --- a/src/Orb/Models/PriceProperties/BulkBPSProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.BulkBPSProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType BulkBPS = new("bulk_bps"); - - readonly string _value = value; - - public enum Value - { - BulkBPS, - } - - public Value Known() => - _value switch - { - "bulk_bps" => Value.BulkBPS, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/BulkProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BulkProperties/ModelType.cs deleted file mode 100644 index e857d5b0b..000000000 --- a/src/Orb/Models/PriceProperties/BulkProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.BulkProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType Bulk = new("bulk"); - - readonly string _value = value; - - public enum Value - { - Bulk, - } - - public Value Known() => - _value switch - { - "bulk" => Value.Bulk, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/BulkWithProration.cs b/src/Orb/Models/PriceProperties/BulkWithProration.cs index a07d1038b..427f59a94 100644 --- a/src/Orb/Models/PriceProperties/BulkWithProration.cs +++ b/src/Orb/Models/PriceProperties/BulkWithProration.cs @@ -371,7 +371,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required BulkWithProrationProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -381,8 +381,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -507,7 +506,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"bulk_with_proration\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +521,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public BulkWithProration() { } + public BulkWithProration() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"bulk_with_proration\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ModelType.cs deleted file mode 100644 index 97b927e9d..000000000 --- a/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.BulkWithProrationProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType BulkWithProration = new("bulk_with_proration"); - - readonly string _value = value; - - public enum Value - { - BulkWithProration, - } - - public Value Known() => - _value switch - { - "bulk_with_proration" => Value.BulkWithProration, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs b/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs index c5d42fd6c..b2a87ef5f 100644 --- a/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs +++ b/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs @@ -373,7 +373,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required CumulativeGroupedBulkProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -383,9 +383,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -511,7 +509,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"cumulative_grouped_bulk\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +524,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public CumulativeGroupedBulk() { } + public CumulativeGroupedBulk() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"cumulative_grouped_bulk\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ModelType.cs b/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ModelType.cs deleted file mode 100644 index ea123de56..000000000 --- a/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.CumulativeGroupedBulkProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType CumulativeGroupedBulk = new("cumulative_grouped_bulk"); - - readonly string _value = value; - - public enum Value - { - CumulativeGroupedBulk, - } - - public Value Known() => - _value switch - { - "cumulative_grouped_bulk" => Value.CumulativeGroupedBulk, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/GroupedAllocation.cs b/src/Orb/Models/PriceProperties/GroupedAllocation.cs index 7bf480289..1d1ed2868 100644 --- a/src/Orb/Models/PriceProperties/GroupedAllocation.cs +++ b/src/Orb/Models/PriceProperties/GroupedAllocation.cs @@ -371,7 +371,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required GroupedAllocationProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -381,8 +381,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -507,7 +506,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"grouped_allocation\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +521,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public GroupedAllocation() { } + public GroupedAllocation() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"grouped_allocation\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ModelType.cs deleted file mode 100644 index 0c314bef9..000000000 --- a/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.GroupedAllocationProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType GroupedAllocation = new("grouped_allocation"); - - readonly string _value = value; - - public enum Value - { - GroupedAllocation, - } - - public Value Known() => - _value switch - { - "grouped_allocation" => Value.GroupedAllocation, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/GroupedTiered.cs b/src/Orb/Models/PriceProperties/GroupedTiered.cs index f197c0986..ce7bbfb33 100644 --- a/src/Orb/Models/PriceProperties/GroupedTiered.cs +++ b/src/Orb/Models/PriceProperties/GroupedTiered.cs @@ -368,7 +368,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required GroupedTieredProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -378,8 +378,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -504,7 +503,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"grouped_tiered\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -512,7 +518,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public GroupedTiered() { } + public GroupedTiered() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"grouped_tiered\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs b/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs index 081748393..6ef5d7c63 100644 --- a/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs +++ b/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs @@ -373,7 +373,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required GroupedTieredPackageProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -383,9 +383,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -511,7 +509,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"grouped_tiered_package\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +524,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public GroupedTieredPackage() { } + public GroupedTieredPackage() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"grouped_tiered_package\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ModelType.cs deleted file mode 100644 index aa00e7757..000000000 --- a/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.GroupedTieredPackageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType GroupedTieredPackage = new("grouped_tiered_package"); - - readonly string _value = value; - - public enum Value - { - GroupedTieredPackage, - } - - public Value Known() => - _value switch - { - "grouped_tiered_package" => Value.GroupedTieredPackage, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/GroupedTieredProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedTieredProperties/ModelType.cs deleted file mode 100644 index eccf9fb98..000000000 --- a/src/Orb/Models/PriceProperties/GroupedTieredProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.GroupedTieredProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType GroupedTiered = new("grouped_tiered"); - - readonly string _value = value; - - public enum Value - { - GroupedTiered, - } - - public Value Known() => - _value switch - { - "grouped_tiered" => Value.GroupedTiered, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs index e299d68c0..c0f75e82c 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs @@ -373,7 +373,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required GroupedWithMeteredMinimumProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -383,9 +383,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -511,7 +509,16 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize( + "\"grouped_with_metered_minimum\"" + ) + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +526,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public GroupedWithMeteredMinimum() { } + public GroupedWithMeteredMinimum() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"grouped_with_metered_minimum\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ModelType.cs deleted file mode 100644 index 2c5e63ea5..000000000 --- a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ModelType.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.GroupedWithMeteredMinimumProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType GroupedWithMeteredMinimum = new( - "grouped_with_metered_minimum" - ); - - readonly string _value = value; - - public enum Value - { - GroupedWithMeteredMinimum, - } - - public Value Known() => - _value switch - { - "grouped_with_metered_minimum" => Value.GroupedWithMeteredMinimum, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs index c094eb3e5..9a3d02592 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs @@ -376,7 +376,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required GroupedWithMinMaxThresholdsProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -386,9 +386,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -514,7 +512,16 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize( + "\"grouped_with_min_max_thresholds\"" + ) + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -522,7 +529,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public GroupedWithMinMaxThresholds() { } + public GroupedWithMinMaxThresholds() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"grouped_with_min_max_thresholds\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs deleted file mode 100644 index f637956e0..000000000 --- a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ModelType.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.GroupedWithMinMaxThresholdsProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType GroupedWithMinMaxThresholds = new( - "grouped_with_min_max_thresholds" - ); - - readonly string _value = value; - - public enum Value - { - GroupedWithMinMaxThresholds, - } - - public Value Known() => - _value switch - { - "grouped_with_min_max_thresholds" => Value.GroupedWithMinMaxThresholds, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs index 41f698c57..4b8a09090 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs @@ -374,7 +374,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required GroupedWithProratedMinimumProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -384,9 +384,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -512,7 +510,16 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize( + "\"grouped_with_prorated_minimum\"" + ) + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -520,7 +527,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public GroupedWithProratedMinimum() { } + public GroupedWithProratedMinimum() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"grouped_with_prorated_minimum\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ModelType.cs deleted file mode 100644 index 131cfeae9..000000000 --- a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ModelType.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.GroupedWithProratedMinimumProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType GroupedWithProratedMinimum = new( - "grouped_with_prorated_minimum" - ); - - readonly string _value = value; - - public enum Value - { - GroupedWithProratedMinimum, - } - - public Value Known() => - _value switch - { - "grouped_with_prorated_minimum" => Value.GroupedWithProratedMinimum, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/Matrix.cs b/src/Orb/Models/PriceProperties/Matrix.cs index 55bb6f4ee..b58a49dbf 100644 --- a/src/Orb/Models/PriceProperties/Matrix.cs +++ b/src/Orb/Models/PriceProperties/Matrix.cs @@ -360,7 +360,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required MatrixProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -370,8 +370,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -493,7 +492,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"matrix\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -501,7 +507,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public Matrix() { } + public Matrix() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"matrix\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/MatrixProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MatrixProperties/ModelType.cs deleted file mode 100644 index e4630d3ac..000000000 --- a/src/Orb/Models/PriceProperties/MatrixProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.MatrixProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType Matrix = new("matrix"); - - readonly string _value = value; - - public enum Value - { - Matrix, - } - - public Value Known() => - _value switch - { - "matrix" => Value.Matrix, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs b/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs index c0d2c3e66..c92c82829 100644 --- a/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs +++ b/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs @@ -372,7 +372,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required MatrixWithAllocationProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -382,9 +382,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -507,7 +505,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"matrix_with_allocation\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +520,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public MatrixWithAllocation() { } + public MatrixWithAllocation() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"matrix_with_allocation\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ModelType.cs deleted file mode 100644 index 4b98b4679..000000000 --- a/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.MatrixWithAllocationProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType MatrixWithAllocation = new("matrix_with_allocation"); - - readonly string _value = value; - - public enum Value - { - MatrixWithAllocation, - } - - public Value Known() => - _value switch - { - "matrix_with_allocation" => Value.MatrixWithAllocation, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs b/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs index 2d7a262ca..7249261af 100644 --- a/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs +++ b/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs @@ -373,7 +373,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required MatrixWithDisplayNameProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -383,9 +383,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -511,7 +509,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"matrix_with_display_name\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +524,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public MatrixWithDisplayName() { } + public MatrixWithDisplayName() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"matrix_with_display_name\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ModelType.cs deleted file mode 100644 index cd32ab4d3..000000000 --- a/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.MatrixWithDisplayNameProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType MatrixWithDisplayName = new("matrix_with_display_name"); - - readonly string _value = value; - - public enum Value - { - MatrixWithDisplayName, - } - - public Value Known() => - _value switch - { - "matrix_with_display_name" => Value.MatrixWithDisplayName, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs b/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs index fb251eece..da2a8fe49 100644 --- a/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs +++ b/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs @@ -373,7 +373,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required MaxGroupTieredPackageProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -383,9 +383,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -511,7 +509,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"max_group_tiered_package\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +524,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public MaxGroupTieredPackage() { } + public MaxGroupTieredPackage() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"max_group_tiered_package\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ModelType.cs deleted file mode 100644 index 091424d8f..000000000 --- a/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.MaxGroupTieredPackageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType MaxGroupTieredPackage = new("max_group_tiered_package"); - - readonly string _value = value; - - public enum Value - { - MaxGroupTieredPackage, - } - - public Value Known() => - _value switch - { - "max_group_tiered_package" => Value.MaxGroupTieredPackage, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/Package.cs b/src/Orb/Models/PriceProperties/Package.cs index 76acf22df..cb4470003 100644 --- a/src/Orb/Models/PriceProperties/Package.cs +++ b/src/Orb/Models/PriceProperties/Package.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required PackageProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -492,7 +491,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"package\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; this.PackageConfig.Validate(); _ = this.PlanPhaseOrder; @@ -501,7 +507,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public Package() { } + public Package() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"package\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/PackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/PackageProperties/ModelType.cs deleted file mode 100644 index 18685d7e4..000000000 --- a/src/Orb/Models/PriceProperties/PackageProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.PackageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType Package = new("package"); - - readonly string _value = value; - - public enum Value - { - Package, - } - - public Value Known() => - _value switch - { - "package" => Value.Package, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/PackageWithAllocation.cs b/src/Orb/Models/PriceProperties/PackageWithAllocation.cs index e3f6832cd..cbcdc4dac 100644 --- a/src/Orb/Models/PriceProperties/PackageWithAllocation.cs +++ b/src/Orb/Models/PriceProperties/PackageWithAllocation.cs @@ -347,7 +347,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required PackageWithAllocationProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -357,9 +357,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -507,7 +505,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"package_with_allocation\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; foreach (var item in this.PackageWithAllocationConfig.Values) { @@ -519,7 +524,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public PackageWithAllocation() { } + public PackageWithAllocation() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"package_with_allocation\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ModelType.cs deleted file mode 100644 index 8f352d0b4..000000000 --- a/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.PackageWithAllocationProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType PackageWithAllocation = new("package_with_allocation"); - - readonly string _value = value; - - public enum Value - { - PackageWithAllocation, - } - - public Value Known() => - _value switch - { - "package_with_allocation" => Value.PackageWithAllocation, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs index abeea9aee..9dc5eba50 100644 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs +++ b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs @@ -347,7 +347,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required ScalableMatrixWithTieredPricingProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -357,9 +357,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -513,7 +511,16 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize( + "\"scalable_matrix_with_tiered_pricing\"" + ) + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -525,7 +532,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public ScalableMatrixWithTieredPricing() { } + public ScalableMatrixWithTieredPricing() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"scalable_matrix_with_tiered_pricing\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ModelType.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ModelType.cs deleted file mode 100644 index 31c195275..000000000 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ModelType.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.ScalableMatrixWithTieredPricingProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType ScalableMatrixWithTieredPricing = new( - "scalable_matrix_with_tiered_pricing" - ); - - readonly string _value = value; - - public enum Value - { - ScalableMatrixWithTieredPricing, - } - - public Value Known() => - _value switch - { - "scalable_matrix_with_tiered_pricing" => Value.ScalableMatrixWithTieredPricing, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs index 97b346bdd..594677b47 100644 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs +++ b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs @@ -347,7 +347,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required ScalableMatrixWithUnitPricingProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -357,9 +357,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -513,7 +511,16 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize( + "\"scalable_matrix_with_unit_pricing\"" + ) + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -525,7 +532,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public ScalableMatrixWithUnitPricing() { } + public ScalableMatrixWithUnitPricing() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"scalable_matrix_with_unit_pricing\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ModelType.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ModelType.cs deleted file mode 100644 index 8ca4bf843..000000000 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ModelType.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.ScalableMatrixWithUnitPricingProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType ScalableMatrixWithUnitPricing = new( - "scalable_matrix_with_unit_pricing" - ); - - readonly string _value = value; - - public enum Value - { - ScalableMatrixWithUnitPricing, - } - - public Value Known() => - _value switch - { - "scalable_matrix_with_unit_pricing" => Value.ScalableMatrixWithUnitPricing, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs b/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs index d2528c346..4ec7db58e 100644 --- a/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs +++ b/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs @@ -347,7 +347,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required ThresholdTotalAmountProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -357,9 +357,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -507,7 +505,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"threshold_total_amount\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +524,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public ThresholdTotalAmount() { } + public ThresholdTotalAmount() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"threshold_total_amount\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ModelType.cs b/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ModelType.cs deleted file mode 100644 index 4ccf6ef8f..000000000 --- a/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.ThresholdTotalAmountProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType ThresholdTotalAmount = new("threshold_total_amount"); - - readonly string _value = value; - - public enum Value - { - ThresholdTotalAmount, - } - - public Value Known() => - _value switch - { - "threshold_total_amount" => Value.ThresholdTotalAmount, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/Tiered.cs b/src/Orb/Models/PriceProperties/Tiered.cs index 61acae337..02ab25ac5 100644 --- a/src/Orb/Models/PriceProperties/Tiered.cs +++ b/src/Orb/Models/PriceProperties/Tiered.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required TieredProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -492,7 +491,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"tiered\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -501,7 +507,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public Tiered() { } + public Tiered() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"tiered\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/TieredBPS.cs b/src/Orb/Models/PriceProperties/TieredBPS.cs index cd46ebe02..708ab379e 100644 --- a/src/Orb/Models/PriceProperties/TieredBPS.cs +++ b/src/Orb/Models/PriceProperties/TieredBPS.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required TieredBPSProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -495,7 +494,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"tiered_bps\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -504,7 +510,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public TieredBPS() { } + public TieredBPS() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"tiered_bps\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/TieredBPSProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredBPSProperties/ModelType.cs deleted file mode 100644 index ea58220b4..000000000 --- a/src/Orb/Models/PriceProperties/TieredBPSProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.TieredBPSProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType TieredBPS = new("tiered_bps"); - - readonly string _value = value; - - public enum Value - { - TieredBPS, - } - - public Value Known() => - _value switch - { - "tiered_bps" => Value.TieredBPS, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/TieredPackage.cs b/src/Orb/Models/PriceProperties/TieredPackage.cs index d3f86789b..429a40bc0 100644 --- a/src/Orb/Models/PriceProperties/TieredPackage.cs +++ b/src/Orb/Models/PriceProperties/TieredPackage.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required TieredPackageProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -500,7 +499,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"tiered_package\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -512,7 +518,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public TieredPackage() { } + public TieredPackage() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"tiered_package\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/TieredPackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredPackageProperties/ModelType.cs deleted file mode 100644 index f211e86e5..000000000 --- a/src/Orb/Models/PriceProperties/TieredPackageProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.TieredPackageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType TieredPackage = new("tiered_package"); - - readonly string _value = value; - - public enum Value - { - TieredPackage, - } - - public Value Known() => - _value switch - { - "tiered_package" => Value.TieredPackage, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs b/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs index 594fa016d..77d790c0e 100644 --- a/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs +++ b/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs @@ -347,7 +347,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required TieredPackageWithMinimumProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -357,9 +357,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -507,7 +505,16 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize( + "\"tiered_package_with_minimum\"" + ) + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +526,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public TieredPackageWithMinimum() { } + public TieredPackageWithMinimum() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"tiered_package_with_minimum\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ModelType.cs deleted file mode 100644 index e3e6e5784..000000000 --- a/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.TieredPackageWithMinimumProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType TieredPackageWithMinimum = new("tiered_package_with_minimum"); - - readonly string _value = value; - - public enum Value - { - TieredPackageWithMinimum, - } - - public Value Known() => - _value switch - { - "tiered_package_with_minimum" => Value.TieredPackageWithMinimum, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/TieredProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredProperties/ModelType.cs deleted file mode 100644 index 846cfadb8..000000000 --- a/src/Orb/Models/PriceProperties/TieredProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.TieredProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType Tiered = new("tiered"); - - readonly string _value = value; - - public enum Value - { - Tiered, - } - - public Value Known() => - _value switch - { - "tiered" => Value.Tiered, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/TieredWithMinimum.cs b/src/Orb/Models/PriceProperties/TieredWithMinimum.cs index ca69b4c94..ef539a2b8 100644 --- a/src/Orb/Models/PriceProperties/TieredWithMinimum.cs +++ b/src/Orb/Models/PriceProperties/TieredWithMinimum.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required TieredWithMinimumProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -503,7 +502,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"tiered_with_minimum\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +521,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public TieredWithMinimum() { } + public TieredWithMinimum() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"tiered_with_minimum\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ModelType.cs deleted file mode 100644 index 7eebbe880..000000000 --- a/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.TieredWithMinimumProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType TieredWithMinimum = new("tiered_with_minimum"); - - readonly string _value = value; - - public enum Value - { - TieredWithMinimum, - } - - public Value Known() => - _value switch - { - "tiered_with_minimum" => Value.TieredWithMinimum, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/TieredWithProration.cs b/src/Orb/Models/PriceProperties/TieredWithProration.cs index 9613ef4b9..a6f061246 100644 --- a/src/Orb/Models/PriceProperties/TieredWithProration.cs +++ b/src/Orb/Models/PriceProperties/TieredWithProration.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required TieredWithProrationProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,9 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize( - element - ) ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -504,7 +502,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"tiered_with_proration\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -516,7 +521,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public TieredWithProration() { } + public TieredWithProration() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"tiered_with_proration\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ModelType.cs deleted file mode 100644 index 1c7a1181d..000000000 --- a/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.TieredWithProrationProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType TieredWithProration = new("tiered_with_proration"); - - readonly string _value = value; - - public enum Value - { - TieredWithProration, - } - - public Value Known() => - _value switch - { - "tiered_with_proration" => Value.TieredWithProration, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/Unit.cs b/src/Orb/Models/PriceProperties/Unit.cs index 01abd0242..547d2382b 100644 --- a/src/Orb/Models/PriceProperties/Unit.cs +++ b/src/Orb/Models/PriceProperties/Unit.cs @@ -342,7 +342,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required UnitProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -352,8 +352,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -490,7 +489,10 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if (!this.ModelType.Equals(Json::JsonSerializer.Deserialize("\"unit\""))) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -499,7 +501,10 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public Unit() { } + public Unit() + { + this.ModelType = Json::JsonSerializer.Deserialize("\"unit\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/UnitProperties/ModelType.cs b/src/Orb/Models/PriceProperties/UnitProperties/ModelType.cs deleted file mode 100644 index 85d8eaab1..000000000 --- a/src/Orb/Models/PriceProperties/UnitProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.UnitProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType Unit = new("unit"); - - readonly string _value = value; - - public enum Value - { - Unit, - } - - public Value Known() => - _value switch - { - "unit" => Value.Unit, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/UnitWithPercent.cs b/src/Orb/Models/PriceProperties/UnitWithPercent.cs index 31848f638..9e21f4e8f 100644 --- a/src/Orb/Models/PriceProperties/UnitWithPercent.cs +++ b/src/Orb/Models/PriceProperties/UnitWithPercent.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required UnitWithPercentProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -503,7 +502,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"unit_with_percent\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +521,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public UnitWithPercent() { } + public UnitWithPercent() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"unit_with_percent\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ModelType.cs b/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ModelType.cs deleted file mode 100644 index 2ab398bd6..000000000 --- a/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.UnitWithPercentProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType UnitWithPercent = new("unit_with_percent"); - - readonly string _value = value; - - public enum Value - { - UnitWithPercent, - } - - public Value Known() => - _value switch - { - "unit_with_percent" => Value.UnitWithPercent, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/PriceProperties/UnitWithProration.cs b/src/Orb/Models/PriceProperties/UnitWithProration.cs index 97447fff9..9619fc358 100644 --- a/src/Orb/Models/PriceProperties/UnitWithProration.cs +++ b/src/Orb/Models/PriceProperties/UnitWithProration.cs @@ -344,7 +344,7 @@ public required string? MinimumAmount set { this.Properties["minimum_amount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required UnitWithProrationProperties::ModelType ModelType + public Json::JsonElement ModelType { get { @@ -354,8 +354,7 @@ public required string? MinimumAmount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("model_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["model_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -503,7 +502,14 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); + if ( + !this.ModelType.Equals( + Json::JsonSerializer.Deserialize("\"unit_with_proration\"") + ) + ) + { + throw new System::Exception(); + } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +521,12 @@ public override void Validate() this.DimensionalPriceConfiguration?.Validate(); } - public UnitWithProration() { } + public UnitWithProration() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"unit_with_proration\"" + ); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ModelType.cs deleted file mode 100644 index 76793b1fb..000000000 --- a/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ModelType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.PriceProperties.UnitWithProrationProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class ModelType(string value) : Orb::IEnum -{ - public static readonly ModelType UnitWithProration = new("unit_with_proration"); - - readonly string _value = value; - - public enum Value - { - UnitWithProration, - } - - public Value Known() => - _value switch - { - "unit_with_proration" => Value.UnitWithProration, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static ModelType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs index 6e3d705b2..9f102457a 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs @@ -1,4 +1,3 @@ -using AmountProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.AmountProperties; using CodeAnalysis = System.Diagnostics.CodeAnalysis; using Generic = System.Collections.Generic; using Json = System.Text.Json; @@ -29,7 +28,7 @@ public required double AmountDiscount set { this.Properties["amount_discount"] = Json::JsonSerializer.SerializeToElement(value); } } - public required AmountProperties::DiscountType DiscountType + public Json::JsonElement DiscountType { get { @@ -39,8 +38,7 @@ public required double AmountDiscount "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("discount_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["discount_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -48,10 +46,20 @@ public required double AmountDiscount public override void Validate() { _ = this.AmountDiscount; - this.DiscountType.Validate(); + if ( + !this.DiscountType.Equals( + Json::JsonSerializer.Deserialize("\"amount\"") + ) + ) + { + throw new System::Exception(); + } } - public Amount() { } + public Amount() + { + this.DiscountType = Json::JsonSerializer.Deserialize("\"amount\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/AmountProperties/DiscountType.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/AmountProperties/DiscountType.cs deleted file mode 100644 index 4ac283b67..000000000 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/AmountProperties/DiscountType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.AmountProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class DiscountType(string value) : Orb::IEnum -{ - public static readonly DiscountType Amount = new("amount"); - - readonly string _value = value; - - public enum Value - { - Amount, - } - - public Value Known() => - _value switch - { - "amount" => Value.Amount, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static DiscountType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs index dd773e581..c1d39f829 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs @@ -2,7 +2,6 @@ using Generic = System.Collections.Generic; using Json = System.Text.Json; using Orb = Orb; -using PercentageProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.PercentageProperties; using Serialization = System.Text.Json.Serialization; using System = System; @@ -11,7 +10,7 @@ namespace Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.Ad [Serialization::JsonConverter(typeof(Orb::ModelConverter))] public sealed record class Percentage : Orb::ModelBase, Orb::IFromRaw { - public required PercentageProperties::DiscountType DiscountType + public Json::JsonElement DiscountType { get { @@ -21,8 +20,7 @@ public sealed record class Percentage : Orb::ModelBase, Orb::IFromRaw(element) - ?? throw new System::ArgumentNullException("discount_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["discount_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -51,11 +49,21 @@ public required double PercentageDiscount public override void Validate() { - this.DiscountType.Validate(); + if ( + !this.DiscountType.Equals( + Json::JsonSerializer.Deserialize("\"percentage\"") + ) + ) + { + throw new System::Exception(); + } _ = this.PercentageDiscount; } - public Percentage() { } + public Percentage() + { + this.DiscountType = Json::JsonSerializer.Deserialize("\"percentage\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/PercentageProperties/DiscountType.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/PercentageProperties/DiscountType.cs deleted file mode 100644 index c6777abde..000000000 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/PercentageProperties/DiscountType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.PercentageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class DiscountType(string value) : Orb::IEnum -{ - public static readonly DiscountType Percentage = new("percentage"); - - readonly string _value = value; - - public enum Value - { - Percentage, - } - - public Value Known() => - _value switch - { - "percentage" => Value.Percentage, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static DiscountType FromRaw(string value) - { - return new(value); - } -} diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs index 7ebf5aa6f..041e259d4 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs @@ -4,14 +4,13 @@ using Orb = Orb; using Serialization = System.Text.Json.Serialization; using System = System; -using UsageProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.UsageProperties; namespace Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties; [Serialization::JsonConverter(typeof(Orb::ModelConverter))] public sealed record class Usage : Orb::ModelBase, Orb::IFromRaw { - public required UsageProperties::DiscountType DiscountType + public Json::JsonElement DiscountType { get { @@ -21,8 +20,7 @@ public sealed record class Usage : Orb::ModelBase, Orb::IFromRaw "Missing required argument" ); - return Json::JsonSerializer.Deserialize(element) - ?? throw new System::ArgumentNullException("discount_type"); + return Json::JsonSerializer.Deserialize(element); } set { this.Properties["discount_type"] = Json::JsonSerializer.SerializeToElement(value); } } @@ -48,11 +46,21 @@ public required double UsageDiscount public override void Validate() { - this.DiscountType.Validate(); + if ( + !this.DiscountType.Equals( + Json::JsonSerializer.Deserialize("\"usage\"") + ) + ) + { + throw new System::Exception(); + } _ = this.UsageDiscount; } - public Usage() { } + public Usage() + { + this.DiscountType = Json::JsonSerializer.Deserialize("\"usage\""); + } #pragma warning disable CS8618 [CodeAnalysis::SetsRequiredMembers] diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/UsageProperties/DiscountType.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/UsageProperties/DiscountType.cs deleted file mode 100644 index 1f37c4b10..000000000 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/UsageProperties/DiscountType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Orb = Orb; -using Serialization = System.Text.Json.Serialization; -using System = System; - -namespace Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties.UsageProperties; - -[Serialization::JsonConverter(typeof(Orb::EnumConverter))] -public sealed record class DiscountType(string value) : Orb::IEnum -{ - public static readonly DiscountType Usage = new("usage"); - - readonly string _value = value; - - public enum Value - { - Usage, - } - - public Value Known() => - _value switch - { - "usage" => Value.Usage, - _ => throw new System::ArgumentOutOfRangeException(nameof(_value)), - }; - - public string Raw() - { - return _value; - } - - public void Validate() - { - Known(); - } - - public static DiscountType FromRaw(string value) - { - return new(value); - } -} From 5a6d4322fd6e82838a22f6658a6252f0c76bf367 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:51:39 +0000 Subject: [PATCH 08/10] feat(client): implement implicit union casts --- src/Orb.Tests/Service/Beta/BetaServiceTest.cs | 282 +++---- .../ExternalPlanIDServiceTest.cs | 282 +++---- .../Service/Coupons/CouponServiceTest.cs | 5 +- .../Credits/Ledger/LedgerServiceTest.cs | 80 +- .../Service/Customers/CustomerServiceTest.cs | 43 +- .../Service/Invoices/InvoiceServiceTest.cs | 34 +- .../Service/Plans/PlanServiceTest.cs | 141 ++-- .../Service/Prices/PriceServiceTest.cs | 270 +++---- .../Subscriptions/SubscriptionServiceTest.cs | 747 ++++++++---------- .../Adjustment.cs | 24 +- .../AddAdjustmentProperties/Adjustment.cs | 19 +- .../AddPriceProperties/Price.cs | 131 ++- .../ReplaceAdjustmentProperties/Adjustment.cs | 19 +- .../ReplacePriceProperties/Price.cs | 131 ++- .../AddAdjustmentProperties/Adjustment.cs | 19 +- .../AddPriceProperties/Price.cs | 131 ++- .../ReplaceAdjustmentProperties/Adjustment.cs | 19 +- .../ReplacePriceProperties/Price.cs | 131 ++- .../Beta/PlanVersionProperties/Adjustment.cs | 24 +- .../CouponCreateParamsProperties/Discount.cs | 7 +- .../DiscountProperties/Amount.cs | 8 - .../DiscountProperties/Percentage.cs | 8 - .../Coupons/CouponProperties/Discount.cs | 8 +- .../Body.cs | 16 +- .../BodyProperties/Amendment.cs | 8 - .../BodyProperties/Decrement.cs | 8 - .../BodyProperties/ExpirationChange.cs | 8 - .../BodyProperties/Increment.cs | 8 - .../InvoiceSettingsProperties/InvoiceDate.cs | 6 +- .../BodyProperties/Void.cs | 4 - .../LedgerCreateEntryByExternalIDResponse.cs | 29 +- .../LedgerCreateEntryParamsProperties/Body.cs | 16 +- .../BodyProperties/Amendment.cs | 8 - .../BodyProperties/Decrement.cs | 8 - .../BodyProperties/ExpirationChange.cs | 8 - .../BodyProperties/Increment.cs | 8 - .../InvoiceSettingsProperties/InvoiceDate.cs | 6 +- .../BodyProperties/Void.cs | 4 - .../Ledger/LedgerCreateEntryResponse.cs | 35 +- .../Data.cs | 30 +- .../LedgerListPageResponseProperties/Data.cs | 30 +- .../TaxConfiguration.cs | 15 +- .../TaxConfiguration.cs | 15 +- .../TaxConfiguration.cs | 15 +- src/Orb/Models/Discount.cs | 13 +- src/Orb/Models/InvoiceLevelDiscount.cs | 13 +- .../Adjustment.cs | 24 +- .../SubLineItem.cs | 12 +- .../LineItemProperties/Adjustment.cs | 24 +- .../LineItemProperties/SubLineItem.cs | 12 +- .../LineItemProperties/Adjustment.cs | 24 +- .../LineItemProperties/SubLineItem.cs | 12 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../AdjustmentProperties/Adjustment.cs | 19 +- .../PriceProperties/Price.cs | 131 ++- .../Models/Plans/PlanProperties/Adjustment.cs | 24 +- src/Orb/Models/Price.cs | 126 ++- src/Orb/Models/PriceProperties/BPS.cs | 4 - .../BPSProperties/ConversionRateConfig.cs | 9 +- src/Orb/Models/PriceProperties/Bulk.cs | 4 - src/Orb/Models/PriceProperties/BulkBPS.cs | 8 - .../BulkBPSProperties/ConversionRateConfig.cs | 9 +- .../BulkProperties/ConversionRateConfig.cs | 9 +- .../PriceProperties/BulkWithProration.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/CumulativeGroupedBulk.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/GroupedAllocation.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../Models/PriceProperties/GroupedTiered.cs | 8 - .../PriceProperties/GroupedTieredPackage.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../GroupedWithMeteredMinimum.cs | 10 - .../ConversionRateConfig.cs | 9 +- .../GroupedWithMinMaxThresholds.cs | 10 - .../ConversionRateConfig.cs | 9 +- .../GroupedWithProratedMinimum.cs | 10 - .../ConversionRateConfig.cs | 9 +- src/Orb/Models/PriceProperties/Matrix.cs | 8 - .../MatrixProperties/ConversionRateConfig.cs | 9 +- .../PriceProperties/MatrixWithAllocation.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/MatrixWithDisplayName.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/MaxGroupTieredPackage.cs | 8 - .../ConversionRateConfig.cs | 9 +- src/Orb/Models/PriceProperties/Package.cs | 8 - .../PackageProperties/ConversionRateConfig.cs | 9 +- .../PriceProperties/PackageWithAllocation.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../ScalableMatrixWithTieredPricing.cs | 10 - .../ConversionRateConfig.cs | 9 +- .../ScalableMatrixWithUnitPricing.cs | 10 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/ThresholdTotalAmount.cs | 8 - .../ConversionRateConfig.cs | 9 +- src/Orb/Models/PriceProperties/Tiered.cs | 8 - src/Orb/Models/PriceProperties/TieredBPS.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../Models/PriceProperties/TieredPackage.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../TieredPackageWithMinimum.cs | 10 - .../ConversionRateConfig.cs | 9 +- .../TieredProperties/ConversionRateConfig.cs | 9 +- .../PriceProperties/TieredWithMinimum.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/TieredWithProration.cs | 8 - .../ConversionRateConfig.cs | 9 +- src/Orb/Models/PriceProperties/Unit.cs | 4 - .../UnitProperties/ConversionRateConfig.cs | 9 +- .../Models/PriceProperties/UnitWithPercent.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../PriceProperties/UnitWithProration.cs | 8 - .../ConversionRateConfig.cs | 9 +- .../GroupingValue.cs | 9 +- .../PriceCreateParamsProperties/Body.cs | 134 ++-- .../PriceEvaluationProperties/Price.cs | 133 ++-- .../PriceEvaluationProperties/Price.cs | 133 ++-- .../DiscountInterval.cs | 15 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../ConversionRateConfig.cs | 9 +- .../AddAdjustmentProperties/Adjustment.cs | 19 +- .../AddPriceProperties/Price.cs | 122 ++- .../ReplaceAdjustmentProperties/Adjustment.cs | 19 +- .../ReplacePriceProperties/Price.cs | 122 ++- .../AddAdjustmentProperties/Adjustment.cs | 19 +- .../AddAdjustmentProperties/EndDate.cs | 8 +- .../AddAdjustmentProperties/StartDate.cs | 8 +- .../AddProperties/Discount.cs | 10 +- .../DiscountProperties/Amount.cs | 8 - .../DiscountProperties/Percentage.cs | 8 - .../AddProperties/DiscountProperties/Usage.cs | 8 - .../AddProperties/EndDate.cs | 8 +- .../AddProperties/Price.cs | 133 ++-- .../AddProperties/StartDate.cs | 8 +- .../EditAdjustmentProperties/EndDate.cs | 8 +- .../EditAdjustmentProperties/StartDate.cs | 8 +- .../EditProperties/EndDate.cs | 8 +- .../EditProperties/StartDate.cs | 8 +- .../DiscountInterval.cs | 15 +- .../AddAdjustmentProperties/Adjustment.cs | 19 +- .../AddPriceProperties/Price.cs | 122 ++- .../ReplaceAdjustmentProperties/Adjustment.cs | 19 +- .../ReplacePriceProperties/Price.cs | 122 ++- .../TrialEndDate.cs | 8 +- .../Models/Subscriptions/SubscriptionUsage.cs | 8 +- 228 files changed, 2432 insertions(+), 3368 deletions(-) diff --git a/src/Orb.Tests/Service/Beta/BetaServiceTest.cs b/src/Orb.Tests/Service/Beta/BetaServiceTest.cs index 1cb8bc4aa..ee3b1d68b 100644 --- a/src/Orb.Tests/Service/Beta/BetaServiceTest.cs +++ b/src/Orb.Tests/Service/Beta/BetaServiceTest.cs @@ -1,5 +1,3 @@ -using AddAdjustmentProperties = Orb.Models.Beta.BetaCreatePlanVersionParamsProperties.AddAdjustmentProperties; -using AddPriceProperties = Orb.Models.Beta.BetaCreatePlanVersionParamsProperties.AddPriceProperties; using Beta = Orb.Models.Beta; using BetaCreatePlanVersionParamsProperties = Orb.Models.Beta.BetaCreatePlanVersionParamsProperties; using CustomExpirationProperties = Orb.Models.CustomExpirationProperties; @@ -8,8 +6,6 @@ using NewBillingCycleConfigurationProperties = Orb.Models.NewBillingCycleConfigurationProperties; using NewPercentageDiscountProperties = Orb.Models.NewPercentageDiscountProperties; using NewPlanUnitPriceProperties = Orb.Models.NewPlanUnitPriceProperties; -using ReplaceAdjustmentProperties = Orb.Models.Beta.BetaCreatePlanVersionParamsProperties.ReplaceAdjustmentProperties; -using ReplacePriceProperties = Orb.Models.Beta.BetaCreatePlanVersionParamsProperties.ReplacePriceProperties; using Tasks = System.Threading.Tasks; using Tests = Orb.Tests; using TransformPriceFilterProperties = Orb.Models.TransformPriceFilterProperties; @@ -31,30 +27,27 @@ public class BetaServiceTest : Tests::TestBase [ new BetaCreatePlanVersionParamsProperties::AddAdjustment() { - Adjustment = AddAdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, PlanPhaseOrder = 0, }, ], @@ -75,62 +68,52 @@ public class BetaServiceTest : Tests::TestBase ExpiresAtEndOfCadence = true, }, PlanPhaseOrder = 0, - Price = AddPriceProperties::Price.Create( - new Models::NewPlanUnitPrice() + Price = new Models::NewPlanUnitPrice() + { + Cadence = NewPlanUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewPlanUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewPlanUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewPlanUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewPlanUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, }, ], RemoveAdjustments = @@ -153,30 +136,27 @@ public class BetaServiceTest : Tests::TestBase [ new BetaCreatePlanVersionParamsProperties::ReplaceAdjustment() { - Adjustment = ReplaceAdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, ReplacesAdjustmentID = "replaces_adjustment_id", PlanPhaseOrder = 0, }, @@ -199,62 +179,52 @@ public class BetaServiceTest : Tests::TestBase ExpiresAtEndOfCadence = true, }, PlanPhaseOrder = 0, - Price = ReplacePriceProperties::Price.Create( - new Models::NewPlanUnitPrice() + Price = new Models::NewPlanUnitPrice() + { + Cadence = NewPlanUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewPlanUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewPlanUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewPlanUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewPlanUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, }, ], SetAsDefault = true, diff --git a/src/Orb.Tests/Service/Beta/ExternalPlanID/ExternalPlanIDServiceTest.cs b/src/Orb.Tests/Service/Beta/ExternalPlanID/ExternalPlanIDServiceTest.cs index 8db84ab84..e5e680f6e 100644 --- a/src/Orb.Tests/Service/Beta/ExternalPlanID/ExternalPlanIDServiceTest.cs +++ b/src/Orb.Tests/Service/Beta/ExternalPlanID/ExternalPlanIDServiceTest.cs @@ -1,5 +1,3 @@ -using AddAdjustmentProperties = Orb.Models.Beta.ExternalPlanID.ExternalPlanIDCreatePlanVersionParamsProperties.AddAdjustmentProperties; -using AddPriceProperties = Orb.Models.Beta.ExternalPlanID.ExternalPlanIDCreatePlanVersionParamsProperties.AddPriceProperties; using CustomExpirationProperties = Orb.Models.CustomExpirationProperties; using ExternalPlanID = Orb.Models.Beta.ExternalPlanID; using ExternalPlanIDCreatePlanVersionParamsProperties = Orb.Models.Beta.ExternalPlanID.ExternalPlanIDCreatePlanVersionParamsProperties; @@ -8,8 +6,6 @@ using NewBillingCycleConfigurationProperties = Orb.Models.NewBillingCycleConfigurationProperties; using NewPercentageDiscountProperties = Orb.Models.NewPercentageDiscountProperties; using NewPlanUnitPriceProperties = Orb.Models.NewPlanUnitPriceProperties; -using ReplaceAdjustmentProperties = Orb.Models.Beta.ExternalPlanID.ExternalPlanIDCreatePlanVersionParamsProperties.ReplaceAdjustmentProperties; -using ReplacePriceProperties = Orb.Models.Beta.ExternalPlanID.ExternalPlanIDCreatePlanVersionParamsProperties.ReplacePriceProperties; using Tasks = System.Threading.Tasks; using Tests = Orb.Tests; using TransformPriceFilterProperties = Orb.Models.TransformPriceFilterProperties; @@ -31,30 +27,27 @@ public class ExternalPlanIDServiceTest : Tests::TestBase [ new ExternalPlanIDCreatePlanVersionParamsProperties::AddAdjustment() { - Adjustment = AddAdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, PlanPhaseOrder = 0, }, ], @@ -75,62 +68,52 @@ public class ExternalPlanIDServiceTest : Tests::TestBase ExpiresAtEndOfCadence = true, }, PlanPhaseOrder = 0, - Price = AddPriceProperties::Price.Create( - new Models::NewPlanUnitPrice() + Price = new Models::NewPlanUnitPrice() + { + Cadence = NewPlanUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewPlanUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewPlanUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewPlanUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewPlanUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, }, ], RemoveAdjustments = @@ -153,30 +136,27 @@ public class ExternalPlanIDServiceTest : Tests::TestBase [ new ExternalPlanIDCreatePlanVersionParamsProperties::ReplaceAdjustment() { - Adjustment = ReplaceAdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, ReplacesAdjustmentID = "replaces_adjustment_id", PlanPhaseOrder = 0, }, @@ -199,62 +179,52 @@ public class ExternalPlanIDServiceTest : Tests::TestBase ExpiresAtEndOfCadence = true, }, PlanPhaseOrder = 0, - Price = ReplacePriceProperties::Price.Create( - new Models::NewPlanUnitPrice() + Price = new Models::NewPlanUnitPrice() + { + Cadence = NewPlanUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewPlanUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewPlanUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewPlanUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewPlanUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, }, ], SetAsDefault = true, diff --git a/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs b/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs index c0e5ea8a6..b8bf0c426 100644 --- a/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs +++ b/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs @@ -1,4 +1,3 @@ -using CouponCreateParamsProperties = Orb.Models.Coupons.CouponCreateParamsProperties; using Coupons = Orb.Models.Coupons; using DiscountProperties = Orb.Models.Coupons.CouponCreateParamsProperties.DiscountProperties; using Tasks = System.Threading.Tasks; @@ -14,9 +13,7 @@ public class CouponServiceTest : Tests::TestBase var coupon = await this.client.Coupons.Create( new Coupons::CouponCreateParams() { - Discount = CouponCreateParamsProperties::Discount.Create( - new DiscountProperties::Percentage() { PercentageDiscount = 0 } - ), + Discount = new DiscountProperties::Percentage() { PercentageDiscount = 0 }, RedemptionCode = "HALFOFF", DurationInMonths = 12, MaxRedemptions = 1, diff --git a/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs b/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs index 40a1a0bb0..87bc86a04 100644 --- a/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs +++ b/src/Orb.Tests/Service/Customers/Credits/Ledger/LedgerServiceTest.cs @@ -2,11 +2,7 @@ using BodyProperties1 = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties; using IncrementProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.IncrementProperties; using IncrementProperties1 = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.IncrementProperties; -using InvoiceSettingsProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties.BodyProperties.IncrementProperties.InvoiceSettingsProperties; -using InvoiceSettingsProperties1 = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties.BodyProperties.IncrementProperties.InvoiceSettingsProperties; using Ledger = Orb.Models.Customers.Credits.Ledger; -using LedgerCreateEntryByExternalIDParamsProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryByExternalIDParamsProperties; -using LedgerCreateEntryParamsProperties = Orb.Models.Customers.Credits.Ledger.LedgerCreateEntryParamsProperties; using LedgerListByExternalIDParamsProperties = Orb.Models.Customers.Credits.Ledger.LedgerListByExternalIDParamsProperties; using LedgerListParamsProperties = Orb.Models.Customers.Credits.Ledger.LedgerListParamsProperties; using System = System; @@ -46,28 +42,24 @@ public class LedgerServiceTest : Tests::TestBase new Ledger::LedgerCreateEntryParams() { CustomerID = "customer_id", - Body = LedgerCreateEntryParamsProperties::Body.Create( - new BodyProperties::Increment() + Body = new BodyProperties::Increment() + { + Amount = 0, + Currency = "currency", + Description = "description", + EffectiveDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), + ExpiryDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), + InvoiceSettings = new IncrementProperties::InvoiceSettings() { - Amount = 0, - Currency = "currency", - Description = "description", - EffectiveDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), - ExpiryDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), - InvoiceSettings = new IncrementProperties::InvoiceSettings() - { - AutoCollection = true, - NetTerms = 0, - InvoiceDate = InvoiceSettingsProperties::InvoiceDate.Create( - System::DateOnly.Parse("2019-12-27") - ), - Memo = "memo", - RequireSuccessfulPayment = true, - }, - Metadata = new() { { "foo", "string" } }, - PerUnitCostBasis = "per_unit_cost_basis", - } - ), + AutoCollection = true, + NetTerms = 0, + InvoiceDate = System::DateOnly.Parse("2019-12-27"), + Memo = "memo", + RequireSuccessfulPayment = true, + }, + Metadata = new() { { "foo", "string" } }, + PerUnitCostBasis = "per_unit_cost_basis", + }, } ); response.Validate(); @@ -80,28 +72,24 @@ public class LedgerServiceTest : Tests::TestBase new Ledger::LedgerCreateEntryByExternalIDParams() { ExternalCustomerID = "external_customer_id", - Body = LedgerCreateEntryByExternalIDParamsProperties::Body.Create( - new BodyProperties1::Increment() + Body = new BodyProperties1::Increment() + { + Amount = 0, + Currency = "currency", + Description = "description", + EffectiveDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), + ExpiryDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), + InvoiceSettings = new IncrementProperties1::InvoiceSettings() { - Amount = 0, - Currency = "currency", - Description = "description", - EffectiveDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), - ExpiryDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), - InvoiceSettings = new IncrementProperties1::InvoiceSettings() - { - AutoCollection = true, - NetTerms = 0, - InvoiceDate = InvoiceSettingsProperties1::InvoiceDate.Create( - System::DateOnly.Parse("2019-12-27") - ), - Memo = "memo", - RequireSuccessfulPayment = true, - }, - Metadata = new() { { "foo", "string" } }, - PerUnitCostBasis = "per_unit_cost_basis", - } - ), + AutoCollection = true, + NetTerms = 0, + InvoiceDate = System::DateOnly.Parse("2019-12-27"), + Memo = "memo", + RequireSuccessfulPayment = true, + }, + Metadata = new() { { "foo", "string" } }, + PerUnitCostBasis = "per_unit_cost_basis", + }, } ); response.Validate(); diff --git a/src/Orb.Tests/Service/Customers/CustomerServiceTest.cs b/src/Orb.Tests/Service/Customers/CustomerServiceTest.cs index 96dbc5fee..64b5e28f9 100644 --- a/src/Orb.Tests/Service/Customers/CustomerServiceTest.cs +++ b/src/Orb.Tests/Service/Customers/CustomerServiceTest.cs @@ -68,14 +68,12 @@ public class CustomerServiceTest : Tests::TestBase PostalCode = "postal_code", State = "state", }, - TaxConfiguration = CustomerCreateParamsProperties::TaxConfiguration.Create( - new Customers::NewAvalaraTaxConfiguration() - { - TaxExempt = true, - TaxProvider = NewAvalaraTaxConfigurationProperties::TaxProvider.Avalara, - TaxExemptionCode = "tax_exemption_code", - } - ), + TaxConfiguration = new Customers::NewAvalaraTaxConfiguration() + { + TaxExempt = true, + TaxProvider = NewAvalaraTaxConfigurationProperties::TaxProvider.Avalara, + TaxExemptionCode = "tax_exemption_code", + }, TaxID = new Models::CustomerTaxID() { Country = CustomerTaxIDProperties::Country.Ad, @@ -144,14 +142,12 @@ public class CustomerServiceTest : Tests::TestBase PostalCode = "postal_code", State = "state", }, - TaxConfiguration = CustomerUpdateParamsProperties::TaxConfiguration.Create( - new Customers::NewAvalaraTaxConfiguration() - { - TaxExempt = true, - TaxProvider = NewAvalaraTaxConfigurationProperties::TaxProvider.Avalara, - TaxExemptionCode = "tax_exemption_code", - } - ), + TaxConfiguration = new Customers::NewAvalaraTaxConfiguration() + { + TaxExempt = true, + TaxProvider = NewAvalaraTaxConfigurationProperties::TaxProvider.Avalara, + TaxExemptionCode = "tax_exemption_code", + }, TaxID = new Models::CustomerTaxID() { Country = CustomerTaxIDProperties::Country.Ad, @@ -288,15 +284,12 @@ await this.client.Customers.SyncPaymentMethodsFromGatewayByExternalCustomerID( PostalCode = "postal_code", State = "state", }, - TaxConfiguration = - CustomerUpdateByExternalIDParamsProperties::TaxConfiguration.Create( - new Customers::NewAvalaraTaxConfiguration() - { - TaxExempt = true, - TaxProvider = NewAvalaraTaxConfigurationProperties::TaxProvider.Avalara, - TaxExemptionCode = "tax_exemption_code", - } - ), + TaxConfiguration = new Customers::NewAvalaraTaxConfiguration() + { + TaxExempt = true, + TaxProvider = NewAvalaraTaxConfigurationProperties::TaxProvider.Avalara, + TaxExemptionCode = "tax_exemption_code", + }, TaxID = new Models::CustomerTaxID() { Country = CustomerTaxIDProperties::Country.Ad, diff --git a/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs b/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs index ae1b4e812..fd6ef13d6 100644 --- a/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs +++ b/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs @@ -35,24 +35,22 @@ public class InvoiceServiceTest : Tests::TestBase }, ], CustomerID = "4khy3nwzktxv7", - Discount = Models::Discount.Create( - new Models::PercentageDiscount() - { - DiscountType = PercentageDiscountProperties::DiscountType.Percentage, - PercentageDiscount1 = 0.15, - AppliesToPriceIDs = ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - Reason = "reason", - } - ), + Discount = new Models::PercentageDiscount() + { + DiscountType = PercentageDiscountProperties::DiscountType.Percentage, + PercentageDiscount1 = 0.15, + AppliesToPriceIDs = ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + Reason = "reason", + }, ExternalCustomerID = "external-customer-id", Memo = "An optional memo for my invoice.", Metadata = new() { { "foo", "string" } }, diff --git a/src/Orb.Tests/Service/Plans/PlanServiceTest.cs b/src/Orb.Tests/Service/Plans/PlanServiceTest.cs index 883115833..ddda95cda 100644 --- a/src/Orb.Tests/Service/Plans/PlanServiceTest.cs +++ b/src/Orb.Tests/Service/Plans/PlanServiceTest.cs @@ -1,4 +1,3 @@ -using AdjustmentProperties = Orb.Models.Plans.PlanCreateParamsProperties.AdjustmentProperties; using CustomExpirationProperties = Orb.Models.CustomExpirationProperties; using Models = Orb.Models; using NewAllocationPriceProperties = Orb.Models.NewAllocationPriceProperties; @@ -9,7 +8,6 @@ using PlanListParamsProperties = Orb.Models.Plans.PlanListParamsProperties; using PlanPhaseProperties = Orb.Models.Plans.PlanCreateParamsProperties.PlanPhaseProperties; using Plans = Orb.Models.Plans; -using PriceProperties = Orb.Models.Plans.PlanCreateParamsProperties.PriceProperties; using System = System; using Tasks = System.Threading.Tasks; using Tests = Orb.Tests; @@ -45,92 +43,79 @@ public class PlanServiceTest : Tests::TestBase ExpiresAtEndOfCadence = true, }, PlanPhaseOrder = 0, - Price1 = PriceProperties::Price.Create( - new Models::NewPlanUnitPrice() + Price1 = new Models::NewPlanUnitPrice() + { + Cadence = NewPlanUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewPlanUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewPlanUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewPlanUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewPlanUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, }, ], Adjustments = [ new PlanCreateParamsProperties::Adjustment() { - Adjustment1 = AdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment1 = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, PlanPhaseOrder = 0, }, ], diff --git a/src/Orb.Tests/Service/Prices/PriceServiceTest.cs b/src/Orb.Tests/Service/Prices/PriceServiceTest.cs index 2ea6f903a..7f720da68 100644 --- a/src/Orb.Tests/Service/Prices/PriceServiceTest.cs +++ b/src/Orb.Tests/Service/Prices/PriceServiceTest.cs @@ -2,11 +2,8 @@ using Models = Orb.Models; using NewBillingCycleConfigurationProperties = Orb.Models.NewBillingCycleConfigurationProperties; using NewFloatingUnitPriceProperties = Orb.Models.NewFloatingUnitPriceProperties; -using PriceCreateParamsProperties = Orb.Models.Prices.PriceCreateParamsProperties; using PriceEvaluateMultipleParamsProperties = Orb.Models.Prices.PriceEvaluateMultipleParamsProperties; using PriceEvaluatePreviewEventsParamsProperties = Orb.Models.Prices.PriceEvaluatePreviewEventsParamsProperties; -using PriceEvaluationProperties = Orb.Models.Prices.PriceEvaluateMultipleParamsProperties.PriceEvaluationProperties; -using PriceEvaluationProperties1 = Orb.Models.Prices.PriceEvaluatePreviewEventsParamsProperties.PriceEvaluationProperties; using Prices = Orb.Models.Prices; using System = System; using Tasks = System.Threading.Tasks; @@ -23,54 +20,47 @@ public class PriceServiceTest : Tests::TestBase var price = await this.client.Prices.Create( new Prices::PriceCreateParams() { - Body = PriceCreateParamsProperties::Body.Create( - new Models::NewFloatingUnitPrice() + Body = new Models::NewFloatingUnitPrice() + { + Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, + Currency = "currency", + ItemID = "item_id", + ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() { - Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, - Currency = "currency", - ItemID = "item_id", - ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewFloatingUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + Duration = 0, + DurationUnit = NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() + { + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { - Duration = 0, - DurationUnit = NewBillingCycleConfigurationProperties::DurationUnit.Day, + UnitAmount = "unit_amount", }, - Metadata = new() { { "foo", "string" } }, - } - ), + }, + DimensionalPriceConfiguration = new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + }, } ); price.Validate(); @@ -133,61 +123,51 @@ public class PriceServiceTest : Tests::TestBase ExternalPriceID = "external_price_id", Filter = "my_numeric_property > 100 AND my_other_property = 'bar'", GroupingKeys = ["case when my_event_type = 'foo' then true else false end"], - Price = PriceEvaluationProperties::Price.Create( - new Models::NewFloatingUnitPrice() + Price = new Models::NewFloatingUnitPrice() + { + Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, + Currency = "currency", + ItemID = "item_id", + ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, - Currency = "currency", - ItemID = "item_id", - ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewFloatingUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - } - ), + }, + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + }, PriceID = "price_id", }, ], @@ -227,61 +207,51 @@ public class PriceServiceTest : Tests::TestBase ExternalPriceID = "external_price_id", Filter = "my_numeric_property > 100 AND my_other_property = 'bar'", GroupingKeys = ["case when my_event_type = 'foo' then true else false end"], - Price = PriceEvaluationProperties1::Price.Create( - new Models::NewFloatingUnitPrice() + Price = new Models::NewFloatingUnitPrice() + { + Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, + Currency = "currency", + ItemID = "item_id", + ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() { - Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, - Currency = "currency", - ItemID = "item_id", - ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() + { + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewFloatingUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - } - ), + }, + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + }, PriceID = "price_id", }, ], diff --git a/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs b/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs index fe1db92f5..193b4451d 100644 --- a/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs +++ b/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs @@ -1,13 +1,7 @@ -using AddAdjustmentProperties = Orb.Models.Subscriptions.SubscriptionCreateParamsProperties.AddAdjustmentProperties; -using AddAdjustmentProperties1 = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddAdjustmentProperties; -using AddAdjustmentProperties2 = Orb.Models.Subscriptions.SubscriptionSchedulePlanChangeParamsProperties.AddAdjustmentProperties; -using AddPriceProperties = Orb.Models.Subscriptions.SubscriptionCreateParamsProperties.AddPriceProperties; -using AddPriceProperties1 = Orb.Models.Subscriptions.SubscriptionSchedulePlanChangeParamsProperties.AddPriceProperties; using AddProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties; using CustomExpirationProperties = Orb.Models.CustomExpirationProperties; using DiscountOverrideProperties = Orb.Models.Subscriptions.DiscountOverrideProperties; using DiscountProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.AddProperties.DiscountProperties; -using EditAdjustmentProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.EditAdjustmentProperties; using EditProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.EditProperties; using Json = System.Text.Json; using Models = Orb.Models; @@ -16,10 +10,6 @@ using NewFloatingUnitPriceProperties = Orb.Models.NewFloatingUnitPriceProperties; using NewPercentageDiscountProperties = Orb.Models.NewPercentageDiscountProperties; using NewSubscriptionUnitPriceProperties = Orb.Models.Subscriptions.NewSubscriptionUnitPriceProperties; -using ReplaceAdjustmentProperties = Orb.Models.Subscriptions.SubscriptionCreateParamsProperties.ReplaceAdjustmentProperties; -using ReplaceAdjustmentProperties1 = Orb.Models.Subscriptions.SubscriptionSchedulePlanChangeParamsProperties.ReplaceAdjustmentProperties; -using ReplacePriceProperties = Orb.Models.Subscriptions.SubscriptionCreateParamsProperties.ReplacePriceProperties; -using ReplacePriceProperties1 = Orb.Models.Subscriptions.SubscriptionSchedulePlanChangeParamsProperties.ReplacePriceProperties; using SubscriptionCancelParamsProperties = Orb.Models.Subscriptions.SubscriptionCancelParamsProperties; using SubscriptionCreateParamsProperties = Orb.Models.Subscriptions.SubscriptionCreateParamsProperties; using SubscriptionFetchCostsParamsProperties = Orb.Models.Subscriptions.SubscriptionFetchCostsParamsProperties; @@ -30,7 +20,6 @@ using Subscriptions = Orb.Models.Subscriptions; using SubscriptionSchedulePlanChangeParamsProperties = Orb.Models.Subscriptions.SubscriptionSchedulePlanChangeParamsProperties; using SubscriptionUpdateFixedFeeQuantityParamsProperties = Orb.Models.Subscriptions.SubscriptionUpdateFixedFeeQuantityParamsProperties; -using SubscriptionUpdateTrialParamsProperties = Orb.Models.Subscriptions.SubscriptionUpdateTrialParamsProperties; using System = System; using Tasks = System.Threading.Tasks; using Tests = Orb.Tests; @@ -51,30 +40,27 @@ public class SubscriptionServiceTest : Tests::TestBase [ new SubscriptionCreateParamsProperties::AddAdjustment() { - Adjustment = AddAdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, EndDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), PlanPhaseOrder = 0, StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), @@ -111,62 +97,52 @@ public class SubscriptionServiceTest : Tests::TestBase MaximumAmount = "1.23", MinimumAmount = "1.23", PlanPhaseOrder = 0, - Price = AddPriceProperties::Price.Create( - new Subscriptions::NewSubscriptionUnitPrice() + Price = new Subscriptions::NewSubscriptionUnitPrice() + { + Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() { - Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() + { + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewSubscriptionUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, PriceID = "h74gfhdjvn7ujokd", StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), }, @@ -220,30 +196,27 @@ public class SubscriptionServiceTest : Tests::TestBase [ new SubscriptionCreateParamsProperties::ReplaceAdjustment() { - Adjustment = ReplaceAdjustmentProperties::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, ReplacesAdjustmentID = "replaces_adjustment_id", }, ], @@ -278,62 +251,52 @@ public class SubscriptionServiceTest : Tests::TestBase FixedPriceQuantity = 2, MaximumAmount = "1.23", MinimumAmount = "1.23", - Price = ReplacePriceProperties::Price.Create( - new Subscriptions::NewSubscriptionUnitPrice() + Price = new Subscriptions::NewSubscriptionUnitPrice() + { + Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewSubscriptionUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, PriceID = "h74gfhdjvn7ujokd", }, ], @@ -474,9 +437,7 @@ public class SubscriptionServiceTest : Tests::TestBase [ new SubscriptionPriceIntervalsParamsProperties::Add() { - StartDate = AddProperties::StartDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), + StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), AllocationPrice = new Models::NewAllocationPrice() { Amount = "10.00", @@ -489,15 +450,8 @@ public class SubscriptionServiceTest : Tests::TestBase }, ExpiresAtEndOfCadence = true, }, - Discounts = - [ - AddProperties::Discount.Create( - new DiscountProperties::Amount() { AmountDiscount = 0 } - ), - ], - EndDate = AddProperties::EndDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), + Discounts = [new DiscountProperties::Amount() { AmountDiscount = 0 }], + EndDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), ExternalPriceID = "external_price_id", Filter = "my_property > 100 AND my_other_property = 'bar'", FixedFeeQuantityTransitions = @@ -510,61 +464,51 @@ public class SubscriptionServiceTest : Tests::TestBase ], MaximumAmount = 0, MinimumAmount = 0, - Price = AddProperties::Price.Create( - new Models::NewFloatingUnitPrice() + Price = new Models::NewFloatingUnitPrice() + { + Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, + Currency = "currency", + ItemID = "item_id", + ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewFloatingUnitPriceProperties::Cadence.Annual, - Currency = "currency", - ItemID = "item_id", - ModelType = NewFloatingUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewFloatingUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - } - ), + }, + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + }, PriceID = "h74gfhdjvn7ujokd", UsageCustomerIDs = ["string"], }, @@ -573,36 +517,29 @@ public class SubscriptionServiceTest : Tests::TestBase [ new SubscriptionPriceIntervalsParamsProperties::AddAdjustment() { - Adjustment = AddAdjustmentProperties1::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), - StartDate = AddAdjustmentProperties1::StartDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), - EndDate = AddAdjustmentProperties1::EndDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, + StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), + EndDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), }, ], AllowInvoiceCreditOrVoid = true, @@ -612,9 +549,7 @@ public class SubscriptionServiceTest : Tests::TestBase { PriceIntervalID = "sdfs6wdjvn7ujokd", BillingCycleDay = 0, - EndDate = EditProperties::EndDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), + EndDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), Filter = "my_property > 100 AND my_other_property = 'bar'", FixedFeeQuantityTransitions = [ @@ -624,9 +559,7 @@ public class SubscriptionServiceTest : Tests::TestBase Quantity = 5, }, ], - StartDate = EditProperties::StartDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), + StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), UsageCustomerIDs = ["string"], }, ], @@ -635,12 +568,8 @@ public class SubscriptionServiceTest : Tests::TestBase new SubscriptionPriceIntervalsParamsProperties::EditAdjustment() { AdjustmentIntervalID = "sdfs6wdjvn7ujokd", - EndDate = EditAdjustmentProperties::EndDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), - StartDate = EditAdjustmentProperties::StartDate.Create( - System::DateTime.Parse("2019-12-27T18:11:19.117Z") - ), + EndDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), + StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), }, ], } @@ -678,30 +607,27 @@ public class SubscriptionServiceTest : Tests::TestBase [ new SubscriptionSchedulePlanChangeParamsProperties::AddAdjustment() { - Adjustment = AddAdjustmentProperties2::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, EndDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), PlanPhaseOrder = 0, StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), @@ -738,62 +664,52 @@ public class SubscriptionServiceTest : Tests::TestBase MaximumAmount = "1.23", MinimumAmount = "1.23", PlanPhaseOrder = 0, - Price = AddPriceProperties1::Price.Create( - new Subscriptions::NewSubscriptionUnitPrice() + Price = new Subscriptions::NewSubscriptionUnitPrice() + { + Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() { - Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() + { + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewSubscriptionUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, PriceID = "h74gfhdjvn7ujokd", StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), }, @@ -840,30 +756,27 @@ public class SubscriptionServiceTest : Tests::TestBase [ new SubscriptionSchedulePlanChangeParamsProperties::ReplaceAdjustment() { - Adjustment = ReplaceAdjustmentProperties1::Adjustment.Create( - new Models::NewPercentageDiscount() - { - AdjustmentType = - NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, - PercentageDiscount = 0, - AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, - AppliesToItemIDs = ["item_1", "item_2"], - AppliesToPriceIDs = ["price_1", "price_2"], - Currency = "currency", - Filters = - [ - new Models::TransformPriceFilter() - { - Field = TransformPriceFilterProperties::Field.PriceID, - Operator = - TransformPriceFilterProperties::Operator.Includes, - Values = ["string"], - }, - ], - IsInvoiceLevel = true, - PriceType = NewPercentageDiscountProperties::PriceType.Usage, - } - ), + Adjustment = new Models::NewPercentageDiscount() + { + AdjustmentType = + NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount, + PercentageDiscount = 0, + AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True, + AppliesToItemIDs = ["item_1", "item_2"], + AppliesToPriceIDs = ["price_1", "price_2"], + Currency = "currency", + Filters = + [ + new Models::TransformPriceFilter() + { + Field = TransformPriceFilterProperties::Field.PriceID, + Operator = TransformPriceFilterProperties::Operator.Includes, + Values = ["string"], + }, + ], + IsInvoiceLevel = true, + PriceType = NewPercentageDiscountProperties::PriceType.Usage, + }, ReplacesAdjustmentID = "replaces_adjustment_id", }, ], @@ -898,62 +811,52 @@ public class SubscriptionServiceTest : Tests::TestBase FixedPriceQuantity = 2, MaximumAmount = "1.23", MinimumAmount = "1.23", - Price = ReplacePriceProperties1::Price.Create( - new Subscriptions::NewSubscriptionUnitPrice() + Price = new Subscriptions::NewSubscriptionUnitPrice() + { + Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, + ItemID = "item_id", + ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, + Name = "Annual fee", + UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, + BillableMetricID = "billable_metric_id", + BilledInAdvance = true, + BillingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + ConversionRate = 0, + ConversionRateConfig = new Models::UnitConversionRateConfig() { - Cadence = NewSubscriptionUnitPriceProperties::Cadence.Annual, - ItemID = "item_id", - ModelType = NewSubscriptionUnitPriceProperties::ModelType.Unit, - Name = "Annual fee", - UnitConfig = new Models::UnitConfig() + ConversionRateType = + UnitConversionRateConfigProperties::ConversionRateType.Unit, + UnitConfig = new Models::ConversionRateUnitConfig() { UnitAmount = "unit_amount", }, - BillableMetricID = "billable_metric_id", - BilledInAdvance = true, - BillingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - ConversionRate = 0, - ConversionRateConfig = - NewSubscriptionUnitPriceProperties::ConversionRateConfig.Create( - new Models::UnitConversionRateConfig() - { - ConversionRateType = - UnitConversionRateConfigProperties::ConversionRateType.Unit, - UnitConfig = new Models::ConversionRateUnitConfig() - { - UnitAmount = "unit_amount", - }, - } - ), - Currency = "currency", - DimensionalPriceConfiguration = - new Models::NewDimensionalPriceConfiguration() - { - DimensionValues = ["string"], - DimensionalPriceGroupID = "dimensional_price_group_id", - ExternalDimensionalPriceGroupID = - "external_dimensional_price_group_id", - }, - ExternalPriceID = "external_price_id", - FixedPriceQuantity = 0, - InvoiceGroupingKey = "x", - InvoicingCycleConfiguration = - new Models::NewBillingCycleConfiguration() - { - Duration = 0, - DurationUnit = - NewBillingCycleConfigurationProperties::DurationUnit.Day, - }, - Metadata = new() { { "foo", "string" } }, - ReferenceID = "reference_id", - } - ), + }, + Currency = "currency", + DimensionalPriceConfiguration = + new Models::NewDimensionalPriceConfiguration() + { + DimensionValues = ["string"], + DimensionalPriceGroupID = "dimensional_price_group_id", + ExternalDimensionalPriceGroupID = + "external_dimensional_price_group_id", + }, + ExternalPriceID = "external_price_id", + FixedPriceQuantity = 0, + InvoiceGroupingKey = "x", + InvoicingCycleConfiguration = new Models::NewBillingCycleConfiguration() + { + Duration = 0, + DurationUnit = + NewBillingCycleConfigurationProperties::DurationUnit.Day, + }, + Metadata = new() { { "foo", "string" } }, + ReferenceID = "reference_id", + }, PriceID = "h74gfhdjvn7ujokd", }, ], @@ -1040,9 +943,7 @@ public class SubscriptionServiceTest : Tests::TestBase new Subscriptions::SubscriptionUpdateTrialParams() { SubscriptionID = "subscription_id", - TrialEndDate = SubscriptionUpdateTrialParamsProperties::TrialEndDate.Create( - System::DateTime.Parse("2017-07-21T17:32:28Z") - ), + TrialEndDate = System::DateTime.Parse("2017-07-21T17:32:28Z"), Shift = true, } ); diff --git a/src/Orb/Models/AdjustmentIntervalProperties/Adjustment.cs b/src/Orb/Models/AdjustmentIntervalProperties/Adjustment.cs index a58dae8b0..0c4108c10 100644 --- a/src/Orb/Models/AdjustmentIntervalProperties/Adjustment.cs +++ b/src/Orb/Models/AdjustmentIntervalProperties/Adjustment.cs @@ -10,25 +10,21 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::PlanPhaseUsageDiscountAdjustment Create( - Models::PlanPhaseUsageDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseUsageDiscountAdjustment value) => + new AdjustmentVariants::PlanPhaseUsageDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhaseAmountDiscountAdjustment Create( - Models::PlanPhaseAmountDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseAmountDiscountAdjustment value) => + new AdjustmentVariants::PlanPhaseAmountDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhasePercentageDiscountAdjustment Create( + public static implicit operator Adjustment( Models::PlanPhasePercentageDiscountAdjustment value - ) => new(value); + ) => new AdjustmentVariants::PlanPhasePercentageDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhaseMinimumAdjustment Create( - Models::PlanPhaseMinimumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseMinimumAdjustment value) => + new AdjustmentVariants::PlanPhaseMinimumAdjustment(value); - public static AdjustmentVariants::PlanPhaseMaximumAdjustment Create( - Models::PlanPhaseMaximumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseMaximumAdjustment value) => + new AdjustmentVariants::PlanPhaseMaximumAdjustment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs index b5dcbf0ce..8aec49d66 100644 --- a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs index 401cec519..4814650c3 100644 --- a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs +++ b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs @@ -13,110 +13,91 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewPlanUnitPrice Create(Models::NewPlanUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanUnitPrice value) => + new PriceVariants::NewPlanUnitPrice(value); - public static PriceVariants::NewPlanPackagePrice Create(Models::NewPlanPackagePrice value) => - new(value); + public static implicit operator Price(Models::NewPlanPackagePrice value) => + new PriceVariants::NewPlanPackagePrice(value); - public static PriceVariants::NewPlanMatrixPrice Create(Models::NewPlanMatrixPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanMatrixPrice value) => + new PriceVariants::NewPlanMatrixPrice(value); - public static PriceVariants::NewPlanTieredPrice Create(Models::NewPlanTieredPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanTieredPrice value) => + new PriceVariants::NewPlanTieredPrice(value); - public static PriceVariants::NewPlanTieredBPSPrice Create( - Models::NewPlanTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredBPSPrice value) => + new PriceVariants::NewPlanTieredBPSPrice(value); - public static PriceVariants::NewPlanBPSPrice Create(Models::NewPlanBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBPSPrice value) => + new PriceVariants::NewPlanBPSPrice(value); - public static PriceVariants::NewPlanBulkBPSPrice Create(Models::NewPlanBulkBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkBPSPrice value) => + new PriceVariants::NewPlanBulkBPSPrice(value); - public static PriceVariants::NewPlanBulkPrice Create(Models::NewPlanBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkPrice value) => + new PriceVariants::NewPlanBulkPrice(value); - public static PriceVariants::NewPlanThresholdTotalAmountPrice Create( - Models::NewPlanThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanThresholdTotalAmountPrice value) => + new PriceVariants::NewPlanThresholdTotalAmountPrice(value); - public static PriceVariants::NewPlanTieredPackagePrice Create( - Models::NewPlanTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackagePrice value) => + new PriceVariants::NewPlanTieredPackagePrice(value); - public static PriceVariants::NewPlanTieredWithMinimumPrice Create( - Models::NewPlanTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredWithMinimumPrice value) => + new PriceVariants::NewPlanTieredWithMinimumPrice(value); - public static PriceVariants::NewPlanUnitWithPercentPrice Create( - Models::NewPlanUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithPercentPrice value) => + new PriceVariants::NewPlanUnitWithPercentPrice(value); - public static PriceVariants::NewPlanPackageWithAllocationPrice Create( - Models::NewPlanPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanPackageWithAllocationPrice value) => + new PriceVariants::NewPlanPackageWithAllocationPrice(value); - public static PriceVariants::NewPlanTierWithProrationPrice Create( - Models::NewPlanTierWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTierWithProrationPrice value) => + new PriceVariants::NewPlanTierWithProrationPrice(value); - public static PriceVariants::NewPlanUnitWithProrationPrice Create( - Models::NewPlanUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithProrationPrice value) => + new PriceVariants::NewPlanUnitWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedAllocationPrice Create( - Models::NewPlanGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedAllocationPrice value) => + new PriceVariants::NewPlanGroupedAllocationPrice(value); - public static PriceVariants::NewPlanGroupedWithProratedMinimumPrice Create( - Models::NewPlanGroupedWithProratedMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithProratedMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewPlanGroupedWithMeteredMinimumPrice Create( - Models::NewPlanGroupedWithMeteredMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithMeteredMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithDisplayNamePrice Create( - Models::NewPlanMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithDisplayNamePrice value) => + new PriceVariants::NewPlanMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewPlanBulkWithProrationPrice Create( - Models::NewPlanBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanBulkWithProrationPrice value) => + new PriceVariants::NewPlanBulkWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPackagePrice Create( - Models::NewPlanGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPackagePrice value) => + new PriceVariants::NewPlanGroupedTieredPackagePrice(value); - public static PriceVariants::NewPlanMaxGroupTieredPackagePrice Create( - Models::NewPlanMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMaxGroupTieredPackagePrice value) => + new PriceVariants::NewPlanMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewPlanCumulativeGroupedBulkPrice Create( - Models::NewPlanCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanCumulativeGroupedBulkPrice value) => + new PriceVariants::NewPlanCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewPlanTieredPackageWithMinimumPrice Create( - Models::NewPlanTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackageWithMinimumPrice value) => + new PriceVariants::NewPlanTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithAllocationPrice Create( - Models::NewPlanMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithAllocationPrice value) => + new PriceVariants::NewPlanMatrixWithAllocationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPrice Create( - Models::NewPlanGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPrice value) => + new PriceVariants::NewPlanGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs index 342e9fb11..9f6ab0dfa 100644 --- a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs index 237330c73..84bd47ec6 100644 --- a/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs +++ b/src/Orb/Models/Beta/BetaCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs @@ -13,110 +13,91 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewPlanUnitPrice Create(Models::NewPlanUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanUnitPrice value) => + new PriceVariants::NewPlanUnitPrice(value); - public static PriceVariants::NewPlanPackagePrice Create(Models::NewPlanPackagePrice value) => - new(value); + public static implicit operator Price(Models::NewPlanPackagePrice value) => + new PriceVariants::NewPlanPackagePrice(value); - public static PriceVariants::NewPlanMatrixPrice Create(Models::NewPlanMatrixPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanMatrixPrice value) => + new PriceVariants::NewPlanMatrixPrice(value); - public static PriceVariants::NewPlanTieredPrice Create(Models::NewPlanTieredPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanTieredPrice value) => + new PriceVariants::NewPlanTieredPrice(value); - public static PriceVariants::NewPlanTieredBPSPrice Create( - Models::NewPlanTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredBPSPrice value) => + new PriceVariants::NewPlanTieredBPSPrice(value); - public static PriceVariants::NewPlanBPSPrice Create(Models::NewPlanBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBPSPrice value) => + new PriceVariants::NewPlanBPSPrice(value); - public static PriceVariants::NewPlanBulkBPSPrice Create(Models::NewPlanBulkBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkBPSPrice value) => + new PriceVariants::NewPlanBulkBPSPrice(value); - public static PriceVariants::NewPlanBulkPrice Create(Models::NewPlanBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkPrice value) => + new PriceVariants::NewPlanBulkPrice(value); - public static PriceVariants::NewPlanThresholdTotalAmountPrice Create( - Models::NewPlanThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanThresholdTotalAmountPrice value) => + new PriceVariants::NewPlanThresholdTotalAmountPrice(value); - public static PriceVariants::NewPlanTieredPackagePrice Create( - Models::NewPlanTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackagePrice value) => + new PriceVariants::NewPlanTieredPackagePrice(value); - public static PriceVariants::NewPlanTieredWithMinimumPrice Create( - Models::NewPlanTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredWithMinimumPrice value) => + new PriceVariants::NewPlanTieredWithMinimumPrice(value); - public static PriceVariants::NewPlanUnitWithPercentPrice Create( - Models::NewPlanUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithPercentPrice value) => + new PriceVariants::NewPlanUnitWithPercentPrice(value); - public static PriceVariants::NewPlanPackageWithAllocationPrice Create( - Models::NewPlanPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanPackageWithAllocationPrice value) => + new PriceVariants::NewPlanPackageWithAllocationPrice(value); - public static PriceVariants::NewPlanTierWithProrationPrice Create( - Models::NewPlanTierWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTierWithProrationPrice value) => + new PriceVariants::NewPlanTierWithProrationPrice(value); - public static PriceVariants::NewPlanUnitWithProrationPrice Create( - Models::NewPlanUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithProrationPrice value) => + new PriceVariants::NewPlanUnitWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedAllocationPrice Create( - Models::NewPlanGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedAllocationPrice value) => + new PriceVariants::NewPlanGroupedAllocationPrice(value); - public static PriceVariants::NewPlanGroupedWithProratedMinimumPrice Create( - Models::NewPlanGroupedWithProratedMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithProratedMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewPlanGroupedWithMeteredMinimumPrice Create( - Models::NewPlanGroupedWithMeteredMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithMeteredMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithDisplayNamePrice Create( - Models::NewPlanMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithDisplayNamePrice value) => + new PriceVariants::NewPlanMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewPlanBulkWithProrationPrice Create( - Models::NewPlanBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanBulkWithProrationPrice value) => + new PriceVariants::NewPlanBulkWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPackagePrice Create( - Models::NewPlanGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPackagePrice value) => + new PriceVariants::NewPlanGroupedTieredPackagePrice(value); - public static PriceVariants::NewPlanMaxGroupTieredPackagePrice Create( - Models::NewPlanMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMaxGroupTieredPackagePrice value) => + new PriceVariants::NewPlanMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewPlanCumulativeGroupedBulkPrice Create( - Models::NewPlanCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanCumulativeGroupedBulkPrice value) => + new PriceVariants::NewPlanCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewPlanTieredPackageWithMinimumPrice Create( - Models::NewPlanTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackageWithMinimumPrice value) => + new PriceVariants::NewPlanTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithAllocationPrice Create( - Models::NewPlanMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithAllocationPrice value) => + new PriceVariants::NewPlanMatrixWithAllocationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPrice Create( - Models::NewPlanGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPrice value) => + new PriceVariants::NewPlanGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs index bd9ab4ca9..90635ce7d 100644 --- a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs index f17071646..9c519a362 100644 --- a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs +++ b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/AddPriceProperties/Price.cs @@ -13,110 +13,91 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewPlanUnitPrice Create(Models::NewPlanUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanUnitPrice value) => + new PriceVariants::NewPlanUnitPrice(value); - public static PriceVariants::NewPlanPackagePrice Create(Models::NewPlanPackagePrice value) => - new(value); + public static implicit operator Price(Models::NewPlanPackagePrice value) => + new PriceVariants::NewPlanPackagePrice(value); - public static PriceVariants::NewPlanMatrixPrice Create(Models::NewPlanMatrixPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanMatrixPrice value) => + new PriceVariants::NewPlanMatrixPrice(value); - public static PriceVariants::NewPlanTieredPrice Create(Models::NewPlanTieredPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanTieredPrice value) => + new PriceVariants::NewPlanTieredPrice(value); - public static PriceVariants::NewPlanTieredBPSPrice Create( - Models::NewPlanTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredBPSPrice value) => + new PriceVariants::NewPlanTieredBPSPrice(value); - public static PriceVariants::NewPlanBPSPrice Create(Models::NewPlanBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBPSPrice value) => + new PriceVariants::NewPlanBPSPrice(value); - public static PriceVariants::NewPlanBulkBPSPrice Create(Models::NewPlanBulkBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkBPSPrice value) => + new PriceVariants::NewPlanBulkBPSPrice(value); - public static PriceVariants::NewPlanBulkPrice Create(Models::NewPlanBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkPrice value) => + new PriceVariants::NewPlanBulkPrice(value); - public static PriceVariants::NewPlanThresholdTotalAmountPrice Create( - Models::NewPlanThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanThresholdTotalAmountPrice value) => + new PriceVariants::NewPlanThresholdTotalAmountPrice(value); - public static PriceVariants::NewPlanTieredPackagePrice Create( - Models::NewPlanTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackagePrice value) => + new PriceVariants::NewPlanTieredPackagePrice(value); - public static PriceVariants::NewPlanTieredWithMinimumPrice Create( - Models::NewPlanTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredWithMinimumPrice value) => + new PriceVariants::NewPlanTieredWithMinimumPrice(value); - public static PriceVariants::NewPlanUnitWithPercentPrice Create( - Models::NewPlanUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithPercentPrice value) => + new PriceVariants::NewPlanUnitWithPercentPrice(value); - public static PriceVariants::NewPlanPackageWithAllocationPrice Create( - Models::NewPlanPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanPackageWithAllocationPrice value) => + new PriceVariants::NewPlanPackageWithAllocationPrice(value); - public static PriceVariants::NewPlanTierWithProrationPrice Create( - Models::NewPlanTierWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTierWithProrationPrice value) => + new PriceVariants::NewPlanTierWithProrationPrice(value); - public static PriceVariants::NewPlanUnitWithProrationPrice Create( - Models::NewPlanUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithProrationPrice value) => + new PriceVariants::NewPlanUnitWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedAllocationPrice Create( - Models::NewPlanGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedAllocationPrice value) => + new PriceVariants::NewPlanGroupedAllocationPrice(value); - public static PriceVariants::NewPlanGroupedWithProratedMinimumPrice Create( - Models::NewPlanGroupedWithProratedMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithProratedMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewPlanGroupedWithMeteredMinimumPrice Create( - Models::NewPlanGroupedWithMeteredMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithMeteredMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithDisplayNamePrice Create( - Models::NewPlanMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithDisplayNamePrice value) => + new PriceVariants::NewPlanMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewPlanBulkWithProrationPrice Create( - Models::NewPlanBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanBulkWithProrationPrice value) => + new PriceVariants::NewPlanBulkWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPackagePrice Create( - Models::NewPlanGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPackagePrice value) => + new PriceVariants::NewPlanGroupedTieredPackagePrice(value); - public static PriceVariants::NewPlanMaxGroupTieredPackagePrice Create( - Models::NewPlanMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMaxGroupTieredPackagePrice value) => + new PriceVariants::NewPlanMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewPlanCumulativeGroupedBulkPrice Create( - Models::NewPlanCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanCumulativeGroupedBulkPrice value) => + new PriceVariants::NewPlanCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewPlanTieredPackageWithMinimumPrice Create( - Models::NewPlanTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackageWithMinimumPrice value) => + new PriceVariants::NewPlanTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithAllocationPrice Create( - Models::NewPlanMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithAllocationPrice value) => + new PriceVariants::NewPlanMatrixWithAllocationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPrice Create( - Models::NewPlanGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPrice value) => + new PriceVariants::NewPlanGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs index 55daca0ce..002d22bf6 100644 --- a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs index cf41ed4e0..2660472b5 100644 --- a/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs +++ b/src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDCreatePlanVersionParamsProperties/ReplacePriceProperties/Price.cs @@ -13,110 +13,91 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewPlanUnitPrice Create(Models::NewPlanUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanUnitPrice value) => + new PriceVariants::NewPlanUnitPrice(value); - public static PriceVariants::NewPlanPackagePrice Create(Models::NewPlanPackagePrice value) => - new(value); + public static implicit operator Price(Models::NewPlanPackagePrice value) => + new PriceVariants::NewPlanPackagePrice(value); - public static PriceVariants::NewPlanMatrixPrice Create(Models::NewPlanMatrixPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanMatrixPrice value) => + new PriceVariants::NewPlanMatrixPrice(value); - public static PriceVariants::NewPlanTieredPrice Create(Models::NewPlanTieredPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanTieredPrice value) => + new PriceVariants::NewPlanTieredPrice(value); - public static PriceVariants::NewPlanTieredBPSPrice Create( - Models::NewPlanTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredBPSPrice value) => + new PriceVariants::NewPlanTieredBPSPrice(value); - public static PriceVariants::NewPlanBPSPrice Create(Models::NewPlanBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBPSPrice value) => + new PriceVariants::NewPlanBPSPrice(value); - public static PriceVariants::NewPlanBulkBPSPrice Create(Models::NewPlanBulkBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkBPSPrice value) => + new PriceVariants::NewPlanBulkBPSPrice(value); - public static PriceVariants::NewPlanBulkPrice Create(Models::NewPlanBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkPrice value) => + new PriceVariants::NewPlanBulkPrice(value); - public static PriceVariants::NewPlanThresholdTotalAmountPrice Create( - Models::NewPlanThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanThresholdTotalAmountPrice value) => + new PriceVariants::NewPlanThresholdTotalAmountPrice(value); - public static PriceVariants::NewPlanTieredPackagePrice Create( - Models::NewPlanTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackagePrice value) => + new PriceVariants::NewPlanTieredPackagePrice(value); - public static PriceVariants::NewPlanTieredWithMinimumPrice Create( - Models::NewPlanTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredWithMinimumPrice value) => + new PriceVariants::NewPlanTieredWithMinimumPrice(value); - public static PriceVariants::NewPlanUnitWithPercentPrice Create( - Models::NewPlanUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithPercentPrice value) => + new PriceVariants::NewPlanUnitWithPercentPrice(value); - public static PriceVariants::NewPlanPackageWithAllocationPrice Create( - Models::NewPlanPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanPackageWithAllocationPrice value) => + new PriceVariants::NewPlanPackageWithAllocationPrice(value); - public static PriceVariants::NewPlanTierWithProrationPrice Create( - Models::NewPlanTierWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTierWithProrationPrice value) => + new PriceVariants::NewPlanTierWithProrationPrice(value); - public static PriceVariants::NewPlanUnitWithProrationPrice Create( - Models::NewPlanUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithProrationPrice value) => + new PriceVariants::NewPlanUnitWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedAllocationPrice Create( - Models::NewPlanGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedAllocationPrice value) => + new PriceVariants::NewPlanGroupedAllocationPrice(value); - public static PriceVariants::NewPlanGroupedWithProratedMinimumPrice Create( - Models::NewPlanGroupedWithProratedMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithProratedMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewPlanGroupedWithMeteredMinimumPrice Create( - Models::NewPlanGroupedWithMeteredMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithMeteredMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithDisplayNamePrice Create( - Models::NewPlanMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithDisplayNamePrice value) => + new PriceVariants::NewPlanMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewPlanBulkWithProrationPrice Create( - Models::NewPlanBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanBulkWithProrationPrice value) => + new PriceVariants::NewPlanBulkWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPackagePrice Create( - Models::NewPlanGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPackagePrice value) => + new PriceVariants::NewPlanGroupedTieredPackagePrice(value); - public static PriceVariants::NewPlanMaxGroupTieredPackagePrice Create( - Models::NewPlanMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMaxGroupTieredPackagePrice value) => + new PriceVariants::NewPlanMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewPlanCumulativeGroupedBulkPrice Create( - Models::NewPlanCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanCumulativeGroupedBulkPrice value) => + new PriceVariants::NewPlanCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewPlanTieredPackageWithMinimumPrice Create( - Models::NewPlanTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackageWithMinimumPrice value) => + new PriceVariants::NewPlanTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithAllocationPrice Create( - Models::NewPlanMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithAllocationPrice value) => + new PriceVariants::NewPlanMatrixWithAllocationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPrice Create( - Models::NewPlanGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPrice value) => + new PriceVariants::NewPlanGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Beta/PlanVersionProperties/Adjustment.cs b/src/Orb/Models/Beta/PlanVersionProperties/Adjustment.cs index 7912e29e6..9113230a3 100644 --- a/src/Orb/Models/Beta/PlanVersionProperties/Adjustment.cs +++ b/src/Orb/Models/Beta/PlanVersionProperties/Adjustment.cs @@ -10,25 +10,21 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::PlanPhaseUsageDiscountAdjustment Create( - Models::PlanPhaseUsageDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseUsageDiscountAdjustment value) => + new AdjustmentVariants::PlanPhaseUsageDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhaseAmountDiscountAdjustment Create( - Models::PlanPhaseAmountDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseAmountDiscountAdjustment value) => + new AdjustmentVariants::PlanPhaseAmountDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhasePercentageDiscountAdjustment Create( + public static implicit operator Adjustment( Models::PlanPhasePercentageDiscountAdjustment value - ) => new(value); + ) => new AdjustmentVariants::PlanPhasePercentageDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhaseMinimumAdjustment Create( - Models::PlanPhaseMinimumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseMinimumAdjustment value) => + new AdjustmentVariants::PlanPhaseMinimumAdjustment(value); - public static AdjustmentVariants::PlanPhaseMaximumAdjustment Create( - Models::PlanPhaseMaximumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseMaximumAdjustment value) => + new AdjustmentVariants::PlanPhaseMaximumAdjustment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/Discount.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/Discount.cs index c0b8fc779..bde26d743 100644 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/Discount.cs +++ b/src/Orb/Models/Coupons/CouponCreateParamsProperties/Discount.cs @@ -10,10 +10,11 @@ public abstract record class Discount { internal Discount() { } - public static DiscountVariants::Percentage Create(DiscountProperties::Percentage value) => - new(value); + public static implicit operator Discount(DiscountProperties::Percentage value) => + new DiscountVariants::Percentage(value); - public static DiscountVariants::Amount Create(DiscountProperties::Amount value) => new(value); + public static implicit operator Discount(DiscountProperties::Amount value) => + new DiscountVariants::Amount(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs index 906ace27c..51f60962a 100644 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs +++ b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Amount.cs @@ -44,14 +44,6 @@ public required string AmountDiscount public override void Validate() { _ = this.AmountDiscount; - if ( - !this.DiscountType.Equals( - Json::JsonSerializer.Deserialize("\"amount\"") - ) - ) - { - throw new System::Exception(); - } } public Amount() diff --git a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs index 8ba83a1c4..57e52e754 100644 --- a/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs +++ b/src/Orb/Models/Coupons/CouponCreateParamsProperties/DiscountProperties/Percentage.cs @@ -45,14 +45,6 @@ public required double PercentageDiscount public override void Validate() { - if ( - !this.DiscountType.Equals( - Json::JsonSerializer.Deserialize("\"percentage\"") - ) - ) - { - throw new System::Exception(); - } _ = this.PercentageDiscount; } diff --git a/src/Orb/Models/Coupons/CouponProperties/Discount.cs b/src/Orb/Models/Coupons/CouponProperties/Discount.cs index 89cd34fa3..1126053ef 100644 --- a/src/Orb/Models/Coupons/CouponProperties/Discount.cs +++ b/src/Orb/Models/Coupons/CouponProperties/Discount.cs @@ -10,11 +10,11 @@ public abstract record class Discount { internal Discount() { } - public static DiscountVariants::PercentageDiscount Create(Models::PercentageDiscount value) => - new(value); + public static implicit operator Discount(Models::PercentageDiscount value) => + new DiscountVariants::PercentageDiscount(value); - public static DiscountVariants::AmountDiscount Create(Models::AmountDiscount value) => - new(value); + public static implicit operator Discount(Models::AmountDiscount value) => + new DiscountVariants::AmountDiscount(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/Body.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/Body.cs index 0b3c3e4d8..6980c528d 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/Body.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/Body.cs @@ -10,16 +10,20 @@ public abstract record class Body { internal Body() { } - public static BodyVariants::Increment Create(BodyProperties::Increment value) => new(value); + public static implicit operator Body(BodyProperties::Increment value) => + new BodyVariants::Increment(value); - public static BodyVariants::Decrement Create(BodyProperties::Decrement value) => new(value); + public static implicit operator Body(BodyProperties::Decrement value) => + new BodyVariants::Decrement(value); - public static BodyVariants::ExpirationChange Create(BodyProperties::ExpirationChange value) => - new(value); + public static implicit operator Body(BodyProperties::ExpirationChange value) => + new BodyVariants::ExpirationChange(value); - public static BodyVariants::Void Create(BodyProperties::Void value) => new(value); + public static implicit operator Body(BodyProperties::Void value) => + new BodyVariants::Void(value); - public static BodyVariants::Amendment Create(BodyProperties::Amendment value) => new(value); + public static implicit operator Body(BodyProperties::Amendment value) => + new BodyVariants::Amendment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs index 5452c8427..0defa5077 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Amendment.cs @@ -117,14 +117,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"amendment\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; if (this.Metadata != null) diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs index 928f39bf8..07bc3dc33 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Decrement.cs @@ -97,14 +97,6 @@ public string? Description public override void Validate() { _ = this.Amount; - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"decrement\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; if (this.Metadata != null) diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs index a5ff0044d..81e5ca0ef 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/ExpirationChange.cs @@ -146,14 +146,6 @@ public string? Description public override void Validate() { - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"expiration_change\"") - ) - ) - { - throw new System::Exception(); - } _ = this.TargetExpiryDate; _ = this.Amount; _ = this.BlockID; diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs index 1a9d10424..8309684cd 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Increment.cs @@ -168,14 +168,6 @@ public string? PerUnitCostBasis public override void Validate() { _ = this.Amount; - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"increment\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; _ = this.EffectiveDate; diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs index 23b18551b..3f65534ce 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs @@ -15,9 +15,11 @@ public abstract record class InvoiceDate { internal InvoiceDate() { } - public static InvoiceDateVariants::Date Create(System::DateOnly value) => new(value); + public static implicit operator InvoiceDate(System::DateOnly value) => + new InvoiceDateVariants::Date(value); - public static InvoiceDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator InvoiceDate(System::DateTime value) => + new InvoiceDateVariants::DateTime(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs index dd47dbd23..50d370581 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/Void.cs @@ -133,10 +133,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - if (!this.EntryType.Equals(Json::JsonSerializer.Deserialize("\"void\""))) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; if (this.Metadata != null) diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDResponse.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDResponse.cs index 1e3b2ce91..b28ebb19e 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDResponse.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDResponse.cs @@ -13,33 +13,32 @@ public abstract record class LedgerCreateEntryByExternalIDResponse { internal LedgerCreateEntryByExternalIDResponse() { } - public static LedgerCreateEntryByExternalIDResponseVariants::IncrementLedgerEntry Create( + public static implicit operator LedgerCreateEntryByExternalIDResponse( IncrementLedgerEntry value - ) => new(value); + ) => new LedgerCreateEntryByExternalIDResponseVariants::IncrementLedgerEntry(value); - public static LedgerCreateEntryByExternalIDResponseVariants::DecrementLedgerEntry Create( + public static implicit operator LedgerCreateEntryByExternalIDResponse( DecrementLedgerEntry value - ) => new(value); + ) => new LedgerCreateEntryByExternalIDResponseVariants::DecrementLedgerEntry(value); - public static LedgerCreateEntryByExternalIDResponseVariants::ExpirationChangeLedgerEntry Create( + public static implicit operator LedgerCreateEntryByExternalIDResponse( ExpirationChangeLedgerEntry value - ) => new(value); + ) => new LedgerCreateEntryByExternalIDResponseVariants::ExpirationChangeLedgerEntry(value); - public static LedgerCreateEntryByExternalIDResponseVariants::CreditBlockExpiryLedgerEntry Create( + public static implicit operator LedgerCreateEntryByExternalIDResponse( CreditBlockExpiryLedgerEntry value - ) => new(value); + ) => new LedgerCreateEntryByExternalIDResponseVariants::CreditBlockExpiryLedgerEntry(value); - public static LedgerCreateEntryByExternalIDResponseVariants::VoidLedgerEntry Create( - VoidLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryByExternalIDResponse(VoidLedgerEntry value) => + new LedgerCreateEntryByExternalIDResponseVariants::VoidLedgerEntry(value); - public static LedgerCreateEntryByExternalIDResponseVariants::VoidInitiatedLedgerEntry Create( + public static implicit operator LedgerCreateEntryByExternalIDResponse( VoidInitiatedLedgerEntry value - ) => new(value); + ) => new LedgerCreateEntryByExternalIDResponseVariants::VoidInitiatedLedgerEntry(value); - public static LedgerCreateEntryByExternalIDResponseVariants::AmendmentLedgerEntry Create( + public static implicit operator LedgerCreateEntryByExternalIDResponse( AmendmentLedgerEntry value - ) => new(value); + ) => new LedgerCreateEntryByExternalIDResponseVariants::AmendmentLedgerEntry(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/Body.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/Body.cs index cb0e525bd..0cc2206b5 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/Body.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/Body.cs @@ -10,16 +10,20 @@ public abstract record class Body { internal Body() { } - public static BodyVariants::Increment Create(BodyProperties::Increment value) => new(value); + public static implicit operator Body(BodyProperties::Increment value) => + new BodyVariants::Increment(value); - public static BodyVariants::Decrement Create(BodyProperties::Decrement value) => new(value); + public static implicit operator Body(BodyProperties::Decrement value) => + new BodyVariants::Decrement(value); - public static BodyVariants::ExpirationChange Create(BodyProperties::ExpirationChange value) => - new(value); + public static implicit operator Body(BodyProperties::ExpirationChange value) => + new BodyVariants::ExpirationChange(value); - public static BodyVariants::Void Create(BodyProperties::Void value) => new(value); + public static implicit operator Body(BodyProperties::Void value) => + new BodyVariants::Void(value); - public static BodyVariants::Amendment Create(BodyProperties::Amendment value) => new(value); + public static implicit operator Body(BodyProperties::Amendment value) => + new BodyVariants::Amendment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs index a5e1edb57..4bd2e7d84 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Amendment.cs @@ -117,14 +117,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"amendment\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; if (this.Metadata != null) diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs index 8f52a0e35..317a8013b 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Decrement.cs @@ -97,14 +97,6 @@ public string? Description public override void Validate() { _ = this.Amount; - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"decrement\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; if (this.Metadata != null) diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs index 86c5aafe8..e9d6a3b80 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/ExpirationChange.cs @@ -146,14 +146,6 @@ public string? Description public override void Validate() { - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"expiration_change\"") - ) - ) - { - throw new System::Exception(); - } _ = this.TargetExpiryDate; _ = this.Amount; _ = this.BlockID; diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs index a36f06066..68374e986 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Increment.cs @@ -168,14 +168,6 @@ public string? PerUnitCostBasis public override void Validate() { _ = this.Amount; - if ( - !this.EntryType.Equals( - Json::JsonSerializer.Deserialize("\"increment\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; _ = this.EffectiveDate; diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs index d9360435a..09d33f6f6 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs @@ -15,9 +15,11 @@ public abstract record class InvoiceDate { internal InvoiceDate() { } - public static InvoiceDateVariants::Date Create(System::DateOnly value) => new(value); + public static implicit operator InvoiceDate(System::DateOnly value) => + new InvoiceDateVariants::Date(value); - public static InvoiceDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator InvoiceDate(System::DateTime value) => + new InvoiceDateVariants::DateTime(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs index be205169b..4bcb490b1 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/Void.cs @@ -133,10 +133,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - if (!this.EntryType.Equals(Json::JsonSerializer.Deserialize("\"void\""))) - { - throw new System::Exception(); - } _ = this.Currency; _ = this.Description; if (this.Metadata != null) diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryResponse.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryResponse.cs index 85cb64d24..c668c86f9 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryResponse.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryResponse.cs @@ -13,33 +13,26 @@ public abstract record class LedgerCreateEntryResponse { internal LedgerCreateEntryResponse() { } - public static LedgerCreateEntryResponseVariants::IncrementLedgerEntry Create( - IncrementLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(IncrementLedgerEntry value) => + new LedgerCreateEntryResponseVariants::IncrementLedgerEntry(value); - public static LedgerCreateEntryResponseVariants::DecrementLedgerEntry Create( - DecrementLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(DecrementLedgerEntry value) => + new LedgerCreateEntryResponseVariants::DecrementLedgerEntry(value); - public static LedgerCreateEntryResponseVariants::ExpirationChangeLedgerEntry Create( - ExpirationChangeLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(ExpirationChangeLedgerEntry value) => + new LedgerCreateEntryResponseVariants::ExpirationChangeLedgerEntry(value); - public static LedgerCreateEntryResponseVariants::CreditBlockExpiryLedgerEntry Create( - CreditBlockExpiryLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(CreditBlockExpiryLedgerEntry value) => + new LedgerCreateEntryResponseVariants::CreditBlockExpiryLedgerEntry(value); - public static LedgerCreateEntryResponseVariants::VoidLedgerEntry Create( - VoidLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(VoidLedgerEntry value) => + new LedgerCreateEntryResponseVariants::VoidLedgerEntry(value); - public static LedgerCreateEntryResponseVariants::VoidInitiatedLedgerEntry Create( - VoidInitiatedLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(VoidInitiatedLedgerEntry value) => + new LedgerCreateEntryResponseVariants::VoidInitiatedLedgerEntry(value); - public static LedgerCreateEntryResponseVariants::AmendmentLedgerEntry Create( - AmendmentLedgerEntry value - ) => new(value); + public static implicit operator LedgerCreateEntryResponse(AmendmentLedgerEntry value) => + new LedgerCreateEntryResponseVariants::AmendmentLedgerEntry(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerListByExternalIDPageResponseProperties/Data.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerListByExternalIDPageResponseProperties/Data.cs index 4409f9a2a..78ab6566a 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerListByExternalIDPageResponseProperties/Data.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerListByExternalIDPageResponseProperties/Data.cs @@ -14,28 +14,26 @@ public abstract record class Data { internal Data() { } - public static DataVariants::IncrementLedgerEntry Create(Ledger::IncrementLedgerEntry value) => - new(value); + public static implicit operator Data(Ledger::IncrementLedgerEntry value) => + new DataVariants::IncrementLedgerEntry(value); - public static DataVariants::DecrementLedgerEntry Create(Ledger::DecrementLedgerEntry value) => - new(value); + public static implicit operator Data(Ledger::DecrementLedgerEntry value) => + new DataVariants::DecrementLedgerEntry(value); - public static DataVariants::ExpirationChangeLedgerEntry Create( - Ledger::ExpirationChangeLedgerEntry value - ) => new(value); + public static implicit operator Data(Ledger::ExpirationChangeLedgerEntry value) => + new DataVariants::ExpirationChangeLedgerEntry(value); - public static DataVariants::CreditBlockExpiryLedgerEntry Create( - Ledger::CreditBlockExpiryLedgerEntry value - ) => new(value); + public static implicit operator Data(Ledger::CreditBlockExpiryLedgerEntry value) => + new DataVariants::CreditBlockExpiryLedgerEntry(value); - public static DataVariants::VoidLedgerEntry Create(Ledger::VoidLedgerEntry value) => new(value); + public static implicit operator Data(Ledger::VoidLedgerEntry value) => + new DataVariants::VoidLedgerEntry(value); - public static DataVariants::VoidInitiatedLedgerEntry Create( - Ledger::VoidInitiatedLedgerEntry value - ) => new(value); + public static implicit operator Data(Ledger::VoidInitiatedLedgerEntry value) => + new DataVariants::VoidInitiatedLedgerEntry(value); - public static DataVariants::AmendmentLedgerEntry Create(Ledger::AmendmentLedgerEntry value) => - new(value); + public static implicit operator Data(Ledger::AmendmentLedgerEntry value) => + new DataVariants::AmendmentLedgerEntry(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/Credits/Ledger/LedgerListPageResponseProperties/Data.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerListPageResponseProperties/Data.cs index 81b04ba8b..302ee2b4c 100644 --- a/src/Orb/Models/Customers/Credits/Ledger/LedgerListPageResponseProperties/Data.cs +++ b/src/Orb/Models/Customers/Credits/Ledger/LedgerListPageResponseProperties/Data.cs @@ -14,28 +14,26 @@ public abstract record class Data { internal Data() { } - public static DataVariants::IncrementLedgerEntry Create(Ledger::IncrementLedgerEntry value) => - new(value); + public static implicit operator Data(Ledger::IncrementLedgerEntry value) => + new DataVariants::IncrementLedgerEntry(value); - public static DataVariants::DecrementLedgerEntry Create(Ledger::DecrementLedgerEntry value) => - new(value); + public static implicit operator Data(Ledger::DecrementLedgerEntry value) => + new DataVariants::DecrementLedgerEntry(value); - public static DataVariants::ExpirationChangeLedgerEntry Create( - Ledger::ExpirationChangeLedgerEntry value - ) => new(value); + public static implicit operator Data(Ledger::ExpirationChangeLedgerEntry value) => + new DataVariants::ExpirationChangeLedgerEntry(value); - public static DataVariants::CreditBlockExpiryLedgerEntry Create( - Ledger::CreditBlockExpiryLedgerEntry value - ) => new(value); + public static implicit operator Data(Ledger::CreditBlockExpiryLedgerEntry value) => + new DataVariants::CreditBlockExpiryLedgerEntry(value); - public static DataVariants::VoidLedgerEntry Create(Ledger::VoidLedgerEntry value) => new(value); + public static implicit operator Data(Ledger::VoidLedgerEntry value) => + new DataVariants::VoidLedgerEntry(value); - public static DataVariants::VoidInitiatedLedgerEntry Create( - Ledger::VoidInitiatedLedgerEntry value - ) => new(value); + public static implicit operator Data(Ledger::VoidInitiatedLedgerEntry value) => + new DataVariants::VoidInitiatedLedgerEntry(value); - public static DataVariants::AmendmentLedgerEntry Create(Ledger::AmendmentLedgerEntry value) => - new(value); + public static implicit operator Data(Ledger::AmendmentLedgerEntry value) => + new DataVariants::AmendmentLedgerEntry(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/CustomerCreateParamsProperties/TaxConfiguration.cs b/src/Orb/Models/Customers/CustomerCreateParamsProperties/TaxConfiguration.cs index 33ced7eca..0f94bc74d 100644 --- a/src/Orb/Models/Customers/CustomerCreateParamsProperties/TaxConfiguration.cs +++ b/src/Orb/Models/Customers/CustomerCreateParamsProperties/TaxConfiguration.cs @@ -10,17 +10,14 @@ public abstract record class TaxConfiguration { internal TaxConfiguration() { } - public static TaxConfigurationVariants::NewAvalaraTaxConfiguration Create( - Customers::NewAvalaraTaxConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewAvalaraTaxConfiguration value) => + new TaxConfigurationVariants::NewAvalaraTaxConfiguration(value); - public static TaxConfigurationVariants::NewTaxJarConfiguration Create( - Customers::NewTaxJarConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewTaxJarConfiguration value) => + new TaxConfigurationVariants::NewTaxJarConfiguration(value); - public static TaxConfigurationVariants::NewSphereConfiguration Create( - Customers::NewSphereConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewSphereConfiguration value) => + new TaxConfigurationVariants::NewSphereConfiguration(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/CustomerUpdateByExternalIDParamsProperties/TaxConfiguration.cs b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParamsProperties/TaxConfiguration.cs index d30dd455c..aefb62ca8 100644 --- a/src/Orb/Models/Customers/CustomerUpdateByExternalIDParamsProperties/TaxConfiguration.cs +++ b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParamsProperties/TaxConfiguration.cs @@ -10,17 +10,14 @@ public abstract record class TaxConfiguration { internal TaxConfiguration() { } - public static TaxConfigurationVariants::NewAvalaraTaxConfiguration Create( - Customers::NewAvalaraTaxConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewAvalaraTaxConfiguration value) => + new TaxConfigurationVariants::NewAvalaraTaxConfiguration(value); - public static TaxConfigurationVariants::NewTaxJarConfiguration Create( - Customers::NewTaxJarConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewTaxJarConfiguration value) => + new TaxConfigurationVariants::NewTaxJarConfiguration(value); - public static TaxConfigurationVariants::NewSphereConfiguration Create( - Customers::NewSphereConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewSphereConfiguration value) => + new TaxConfigurationVariants::NewSphereConfiguration(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Customers/CustomerUpdateParamsProperties/TaxConfiguration.cs b/src/Orb/Models/Customers/CustomerUpdateParamsProperties/TaxConfiguration.cs index 338cf86e6..10ae77226 100644 --- a/src/Orb/Models/Customers/CustomerUpdateParamsProperties/TaxConfiguration.cs +++ b/src/Orb/Models/Customers/CustomerUpdateParamsProperties/TaxConfiguration.cs @@ -10,17 +10,14 @@ public abstract record class TaxConfiguration { internal TaxConfiguration() { } - public static TaxConfigurationVariants::NewAvalaraTaxConfiguration Create( - Customers::NewAvalaraTaxConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewAvalaraTaxConfiguration value) => + new TaxConfigurationVariants::NewAvalaraTaxConfiguration(value); - public static TaxConfigurationVariants::NewTaxJarConfiguration Create( - Customers::NewTaxJarConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewTaxJarConfiguration value) => + new TaxConfigurationVariants::NewTaxJarConfiguration(value); - public static TaxConfigurationVariants::NewSphereConfiguration Create( - Customers::NewSphereConfiguration value - ) => new(value); + public static implicit operator TaxConfiguration(Customers::NewSphereConfiguration value) => + new TaxConfigurationVariants::NewSphereConfiguration(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Discount.cs b/src/Orb/Models/Discount.cs index 92b0dd334..edb984f81 100644 --- a/src/Orb/Models/Discount.cs +++ b/src/Orb/Models/Discount.cs @@ -9,14 +9,17 @@ public abstract record class Discount { internal Discount() { } - public static DiscountVariants::PercentageDiscount Create(PercentageDiscount value) => - new(value); + public static implicit operator Discount(PercentageDiscount value) => + new DiscountVariants::PercentageDiscount(value); - public static DiscountVariants::TrialDiscount Create(TrialDiscount value) => new(value); + public static implicit operator Discount(TrialDiscount value) => + new DiscountVariants::TrialDiscount(value); - public static DiscountVariants::UsageDiscount Create(UsageDiscount value) => new(value); + public static implicit operator Discount(UsageDiscount value) => + new DiscountVariants::UsageDiscount(value); - public static DiscountVariants::AmountDiscount Create(AmountDiscount value) => new(value); + public static implicit operator Discount(AmountDiscount value) => + new DiscountVariants::AmountDiscount(value); public abstract void Validate(); } diff --git a/src/Orb/Models/InvoiceLevelDiscount.cs b/src/Orb/Models/InvoiceLevelDiscount.cs index 849a51212..50c2d3803 100644 --- a/src/Orb/Models/InvoiceLevelDiscount.cs +++ b/src/Orb/Models/InvoiceLevelDiscount.cs @@ -9,15 +9,14 @@ public abstract record class InvoiceLevelDiscount { internal InvoiceLevelDiscount() { } - public static InvoiceLevelDiscountVariants::PercentageDiscount Create( - PercentageDiscount value - ) => new(value); + public static implicit operator InvoiceLevelDiscount(PercentageDiscount value) => + new InvoiceLevelDiscountVariants::PercentageDiscount(value); - public static InvoiceLevelDiscountVariants::AmountDiscount Create(AmountDiscount value) => - new(value); + public static implicit operator InvoiceLevelDiscount(AmountDiscount value) => + new InvoiceLevelDiscountVariants::AmountDiscount(value); - public static InvoiceLevelDiscountVariants::TrialDiscount Create(TrialDiscount value) => - new(value); + public static implicit operator InvoiceLevelDiscount(TrialDiscount value) => + new InvoiceLevelDiscountVariants::TrialDiscount(value); public abstract void Validate(); } diff --git a/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/Adjustment.cs b/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/Adjustment.cs index 461f2f8a6..072c8e8d2 100644 --- a/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/Adjustment.cs +++ b/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/Adjustment.cs @@ -10,25 +10,21 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::MonetaryUsageDiscountAdjustment Create( - Models::MonetaryUsageDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryUsageDiscountAdjustment value) => + new AdjustmentVariants::MonetaryUsageDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryAmountDiscountAdjustment Create( - Models::MonetaryAmountDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryAmountDiscountAdjustment value) => + new AdjustmentVariants::MonetaryAmountDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryPercentageDiscountAdjustment Create( + public static implicit operator Adjustment( Models::MonetaryPercentageDiscountAdjustment value - ) => new(value); + ) => new AdjustmentVariants::MonetaryPercentageDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryMinimumAdjustment Create( - Models::MonetaryMinimumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryMinimumAdjustment value) => + new AdjustmentVariants::MonetaryMinimumAdjustment(value); - public static AdjustmentVariants::MonetaryMaximumAdjustment Create( - Models::MonetaryMaximumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryMaximumAdjustment value) => + new AdjustmentVariants::MonetaryMaximumAdjustment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/SubLineItem.cs b/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/SubLineItem.cs index 5f4d78a8c..8ee6de816 100644 --- a/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/SubLineItem.cs +++ b/src/Orb/Models/InvoiceLineItems/InvoiceLineItemCreateResponseProperties/SubLineItem.cs @@ -10,14 +10,14 @@ public abstract record class SubLineItem { internal SubLineItem() { } - public static SubLineItemVariants::MatrixSubLineItem Create(Models::MatrixSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::MatrixSubLineItem value) => + new SubLineItemVariants::MatrixSubLineItem(value); - public static SubLineItemVariants::TierSubLineItem Create(Models::TierSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::TierSubLineItem value) => + new SubLineItemVariants::TierSubLineItem(value); - public static SubLineItemVariants::OtherSubLineItem Create(Models::OtherSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::OtherSubLineItem value) => + new SubLineItemVariants::OtherSubLineItem(value); public abstract void Validate(); } diff --git a/src/Orb/Models/InvoiceProperties/LineItemProperties/Adjustment.cs b/src/Orb/Models/InvoiceProperties/LineItemProperties/Adjustment.cs index 0f8eec3ea..858c8ffec 100644 --- a/src/Orb/Models/InvoiceProperties/LineItemProperties/Adjustment.cs +++ b/src/Orb/Models/InvoiceProperties/LineItemProperties/Adjustment.cs @@ -10,25 +10,21 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::MonetaryUsageDiscountAdjustment Create( - Models::MonetaryUsageDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryUsageDiscountAdjustment value) => + new AdjustmentVariants::MonetaryUsageDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryAmountDiscountAdjustment Create( - Models::MonetaryAmountDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryAmountDiscountAdjustment value) => + new AdjustmentVariants::MonetaryAmountDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryPercentageDiscountAdjustment Create( + public static implicit operator Adjustment( Models::MonetaryPercentageDiscountAdjustment value - ) => new(value); + ) => new AdjustmentVariants::MonetaryPercentageDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryMinimumAdjustment Create( - Models::MonetaryMinimumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryMinimumAdjustment value) => + new AdjustmentVariants::MonetaryMinimumAdjustment(value); - public static AdjustmentVariants::MonetaryMaximumAdjustment Create( - Models::MonetaryMaximumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryMaximumAdjustment value) => + new AdjustmentVariants::MonetaryMaximumAdjustment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/InvoiceProperties/LineItemProperties/SubLineItem.cs b/src/Orb/Models/InvoiceProperties/LineItemProperties/SubLineItem.cs index dcdb74f65..9e478961d 100644 --- a/src/Orb/Models/InvoiceProperties/LineItemProperties/SubLineItem.cs +++ b/src/Orb/Models/InvoiceProperties/LineItemProperties/SubLineItem.cs @@ -10,14 +10,14 @@ public abstract record class SubLineItem { internal SubLineItem() { } - public static SubLineItemVariants::MatrixSubLineItem Create(Models::MatrixSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::MatrixSubLineItem value) => + new SubLineItemVariants::MatrixSubLineItem(value); - public static SubLineItemVariants::TierSubLineItem Create(Models::TierSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::TierSubLineItem value) => + new SubLineItemVariants::TierSubLineItem(value); - public static SubLineItemVariants::OtherSubLineItem Create(Models::OtherSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::OtherSubLineItem value) => + new SubLineItemVariants::OtherSubLineItem(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/Adjustment.cs b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/Adjustment.cs index 25df91808..94ab2570c 100644 --- a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/Adjustment.cs +++ b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/Adjustment.cs @@ -10,25 +10,21 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::MonetaryUsageDiscountAdjustment Create( - Models::MonetaryUsageDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryUsageDiscountAdjustment value) => + new AdjustmentVariants::MonetaryUsageDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryAmountDiscountAdjustment Create( - Models::MonetaryAmountDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryAmountDiscountAdjustment value) => + new AdjustmentVariants::MonetaryAmountDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryPercentageDiscountAdjustment Create( + public static implicit operator Adjustment( Models::MonetaryPercentageDiscountAdjustment value - ) => new(value); + ) => new AdjustmentVariants::MonetaryPercentageDiscountAdjustment(value); - public static AdjustmentVariants::MonetaryMinimumAdjustment Create( - Models::MonetaryMinimumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryMinimumAdjustment value) => + new AdjustmentVariants::MonetaryMinimumAdjustment(value); - public static AdjustmentVariants::MonetaryMaximumAdjustment Create( - Models::MonetaryMaximumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::MonetaryMaximumAdjustment value) => + new AdjustmentVariants::MonetaryMaximumAdjustment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/SubLineItem.cs b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/SubLineItem.cs index 1f8142e4d..1153f335e 100644 --- a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/SubLineItem.cs +++ b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/SubLineItem.cs @@ -10,14 +10,14 @@ public abstract record class SubLineItem { internal SubLineItem() { } - public static SubLineItemVariants::MatrixSubLineItem Create(Models::MatrixSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::MatrixSubLineItem value) => + new SubLineItemVariants::MatrixSubLineItem(value); - public static SubLineItemVariants::TierSubLineItem Create(Models::TierSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::TierSubLineItem value) => + new SubLineItemVariants::TierSubLineItem(value); - public static SubLineItemVariants::OtherSubLineItem Create(Models::OtherSubLineItem value) => - new(value); + public static implicit operator SubLineItem(Models::OtherSubLineItem value) => + new SubLineItemVariants::OtherSubLineItem(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingBPSPriceProperties/ConversionRateConfig.cs index 50ce01aa8..ada17ddd6 100644 --- a/src/Orb/Models/NewFloatingBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingBulkBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingBulkBPSPriceProperties/ConversionRateConfig.cs index e90ccfdc3..42cb3ff43 100644 --- a/src/Orb/Models/NewFloatingBulkBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingBulkBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingBulkPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingBulkPriceProperties/ConversionRateConfig.cs index bc69f8536..9380ad7ef 100644 --- a/src/Orb/Models/NewFloatingBulkPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingBulkPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingBulkWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingBulkWithProrationPriceProperties/ConversionRateConfig.cs index 29bb42ef8..9032f7846 100644 --- a/src/Orb/Models/NewFloatingBulkWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingBulkWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs index 831bc7921..7063af97b 100644 --- a/src/Orb/Models/NewFloatingCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingGroupedAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingGroupedAllocationPriceProperties/ConversionRateConfig.cs index be94e14da..fe833429d 100644 --- a/src/Orb/Models/NewFloatingGroupedAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingGroupedAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingGroupedTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingGroupedTieredPackagePriceProperties/ConversionRateConfig.cs index 311b7b370..fb4bb29c4 100644 --- a/src/Orb/Models/NewFloatingGroupedTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingGroupedTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingGroupedTieredPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingGroupedTieredPriceProperties/ConversionRateConfig.cs index fb6fc01a8..5209f5eb4 100644 --- a/src/Orb/Models/NewFloatingGroupedTieredPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingGroupedTieredPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs index 47a974022..1f4bafb09 100644 --- a/src/Orb/Models/NewFloatingGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs index 56ad80ec0..fd83917de 100644 --- a/src/Orb/Models/NewFloatingGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingMatrixPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingMatrixPriceProperties/ConversionRateConfig.cs index 0f7738373..d89a419e3 100644 --- a/src/Orb/Models/NewFloatingMatrixPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingMatrixPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingMatrixWithAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingMatrixWithAllocationPriceProperties/ConversionRateConfig.cs index 8496f1dd3..39900a8eb 100644 --- a/src/Orb/Models/NewFloatingMatrixWithAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingMatrixWithAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs index f09bb7e77..a9ca0bf69 100644 --- a/src/Orb/Models/NewFloatingMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs index f8f2c6803..a1d9c3312 100644 --- a/src/Orb/Models/NewFloatingMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingPackagePriceProperties/ConversionRateConfig.cs index e10a17c11..a10ea5c6f 100644 --- a/src/Orb/Models/NewFloatingPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingPackageWithAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingPackageWithAllocationPriceProperties/ConversionRateConfig.cs index 48666ecc2..ded4b4302 100644 --- a/src/Orb/Models/NewFloatingPackageWithAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingPackageWithAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs index 3761223aa..d539dcfbe 100644 --- a/src/Orb/Models/NewFloatingScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs index 3caa82c92..d2f9cc722 100644 --- a/src/Orb/Models/NewFloatingScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingThresholdTotalAmountPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingThresholdTotalAmountPriceProperties/ConversionRateConfig.cs index d3c074bb5..d14f45c9b 100644 --- a/src/Orb/Models/NewFloatingThresholdTotalAmountPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingThresholdTotalAmountPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingTieredBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingTieredBPSPriceProperties/ConversionRateConfig.cs index 46b745883..3e71f8be0 100644 --- a/src/Orb/Models/NewFloatingTieredBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingTieredBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingTieredPackagePriceProperties/ConversionRateConfig.cs index 7992c3f81..da57b5b89 100644 --- a/src/Orb/Models/NewFloatingTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs index f21981367..0b35fad3e 100644 --- a/src/Orb/Models/NewFloatingTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingTieredPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingTieredPriceProperties/ConversionRateConfig.cs index b3a12991b..285ecdf02 100644 --- a/src/Orb/Models/NewFloatingTieredPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingTieredPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingTieredWithMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingTieredWithMinimumPriceProperties/ConversionRateConfig.cs index 0610b1486..f7050321a 100644 --- a/src/Orb/Models/NewFloatingTieredWithMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingTieredWithMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingTieredWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingTieredWithProrationPriceProperties/ConversionRateConfig.cs index 71fb7dc99..b6c7fb593 100644 --- a/src/Orb/Models/NewFloatingTieredWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingTieredWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingUnitPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingUnitPriceProperties/ConversionRateConfig.cs index a07a61464..8c4d89103 100644 --- a/src/Orb/Models/NewFloatingUnitPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingUnitPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingUnitWithPercentPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingUnitWithPercentPriceProperties/ConversionRateConfig.cs index 922cfb2a6..0297b0aca 100644 --- a/src/Orb/Models/NewFloatingUnitWithPercentPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingUnitWithPercentPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewFloatingUnitWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingUnitWithProrationPriceProperties/ConversionRateConfig.cs index a46202de8..742ec4289 100644 --- a/src/Orb/Models/NewFloatingUnitWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewFloatingUnitWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanBPSPriceProperties/ConversionRateConfig.cs index c1fcdde21..1acd4a077 100644 --- a/src/Orb/Models/NewPlanBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanBulkBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanBulkBPSPriceProperties/ConversionRateConfig.cs index f1215e94f..8ed868dcf 100644 --- a/src/Orb/Models/NewPlanBulkBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanBulkBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanBulkPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanBulkPriceProperties/ConversionRateConfig.cs index 4c8893dae..81d2e7312 100644 --- a/src/Orb/Models/NewPlanBulkPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanBulkPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanBulkWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanBulkWithProrationPriceProperties/ConversionRateConfig.cs index 55eedc4c8..441efbe75 100644 --- a/src/Orb/Models/NewPlanBulkWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanBulkWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs index 576958ee6..f50948f77 100644 --- a/src/Orb/Models/NewPlanCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanGroupedAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanGroupedAllocationPriceProperties/ConversionRateConfig.cs index b01958e82..80d285361 100644 --- a/src/Orb/Models/NewPlanGroupedAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanGroupedAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanGroupedTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanGroupedTieredPackagePriceProperties/ConversionRateConfig.cs index e57796389..1310f5c6d 100644 --- a/src/Orb/Models/NewPlanGroupedTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanGroupedTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanGroupedTieredPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanGroupedTieredPriceProperties/ConversionRateConfig.cs index 0b020c742..174baaa1d 100644 --- a/src/Orb/Models/NewPlanGroupedTieredPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanGroupedTieredPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs index 74a3aeb76..7204e850d 100644 --- a/src/Orb/Models/NewPlanGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs index 19ff2e488..d16161af1 100644 --- a/src/Orb/Models/NewPlanGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanMatrixPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanMatrixPriceProperties/ConversionRateConfig.cs index 3f2a4be41..d129d8587 100644 --- a/src/Orb/Models/NewPlanMatrixPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanMatrixPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanMatrixWithAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanMatrixWithAllocationPriceProperties/ConversionRateConfig.cs index 1b9ad4103..741b8903f 100644 --- a/src/Orb/Models/NewPlanMatrixWithAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanMatrixWithAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs index 420050793..93e06c3d7 100644 --- a/src/Orb/Models/NewPlanMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs index 2e58ffe7f..f94010ea9 100644 --- a/src/Orb/Models/NewPlanMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanPackagePriceProperties/ConversionRateConfig.cs index bc06220bf..3e1c40747 100644 --- a/src/Orb/Models/NewPlanPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanPackageWithAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanPackageWithAllocationPriceProperties/ConversionRateConfig.cs index c21a0d18b..fd3ffa5d3 100644 --- a/src/Orb/Models/NewPlanPackageWithAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanPackageWithAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs index 0accc1f3d..1808c3ec6 100644 --- a/src/Orb/Models/NewPlanScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs index ba3f61b31..a025e5aef 100644 --- a/src/Orb/Models/NewPlanScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanThresholdTotalAmountPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanThresholdTotalAmountPriceProperties/ConversionRateConfig.cs index 0cbd035ee..7955c3833 100644 --- a/src/Orb/Models/NewPlanThresholdTotalAmountPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanThresholdTotalAmountPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanTierWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanTierWithProrationPriceProperties/ConversionRateConfig.cs index d81309f3f..c268a6be5 100644 --- a/src/Orb/Models/NewPlanTierWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanTierWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanTieredBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanTieredBPSPriceProperties/ConversionRateConfig.cs index d4f351598..cfbfa8edf 100644 --- a/src/Orb/Models/NewPlanTieredBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanTieredBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanTieredPackagePriceProperties/ConversionRateConfig.cs index f60a21bf6..076d8a524 100644 --- a/src/Orb/Models/NewPlanTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs index b6423460b..e5eb4318d 100644 --- a/src/Orb/Models/NewPlanTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanTieredPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanTieredPriceProperties/ConversionRateConfig.cs index 1ca013e23..319332f70 100644 --- a/src/Orb/Models/NewPlanTieredPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanTieredPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanTieredWithMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanTieredWithMinimumPriceProperties/ConversionRateConfig.cs index 340fd99af..75d8b4676 100644 --- a/src/Orb/Models/NewPlanTieredWithMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanTieredWithMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanUnitPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanUnitPriceProperties/ConversionRateConfig.cs index 06aafcd57..f1c74a892 100644 --- a/src/Orb/Models/NewPlanUnitPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanUnitPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanUnitWithPercentPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanUnitWithPercentPriceProperties/ConversionRateConfig.cs index 6f4933641..e9af85c99 100644 --- a/src/Orb/Models/NewPlanUnitWithPercentPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanUnitWithPercentPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/NewPlanUnitWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewPlanUnitWithProrationPriceProperties/ConversionRateConfig.cs index d68d34535..549dfbd55 100644 --- a/src/Orb/Models/NewPlanUnitWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/NewPlanUnitWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Plans/PlanCreateParamsProperties/AdjustmentProperties/Adjustment.cs b/src/Orb/Models/Plans/PlanCreateParamsProperties/AdjustmentProperties/Adjustment.cs index 89aa6a526..c0c46cecf 100644 --- a/src/Orb/Models/Plans/PlanCreateParamsProperties/AdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Plans/PlanCreateParamsProperties/AdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Plans/PlanCreateParamsProperties/PriceProperties/Price.cs b/src/Orb/Models/Plans/PlanCreateParamsProperties/PriceProperties/Price.cs index d0f2f60b0..cce800c8f 100644 --- a/src/Orb/Models/Plans/PlanCreateParamsProperties/PriceProperties/Price.cs +++ b/src/Orb/Models/Plans/PlanCreateParamsProperties/PriceProperties/Price.cs @@ -13,110 +13,91 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewPlanUnitPrice Create(Models::NewPlanUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanUnitPrice value) => + new PriceVariants::NewPlanUnitPrice(value); - public static PriceVariants::NewPlanPackagePrice Create(Models::NewPlanPackagePrice value) => - new(value); + public static implicit operator Price(Models::NewPlanPackagePrice value) => + new PriceVariants::NewPlanPackagePrice(value); - public static PriceVariants::NewPlanMatrixPrice Create(Models::NewPlanMatrixPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanMatrixPrice value) => + new PriceVariants::NewPlanMatrixPrice(value); - public static PriceVariants::NewPlanTieredPrice Create(Models::NewPlanTieredPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanTieredPrice value) => + new PriceVariants::NewPlanTieredPrice(value); - public static PriceVariants::NewPlanTieredBPSPrice Create( - Models::NewPlanTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredBPSPrice value) => + new PriceVariants::NewPlanTieredBPSPrice(value); - public static PriceVariants::NewPlanBPSPrice Create(Models::NewPlanBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBPSPrice value) => + new PriceVariants::NewPlanBPSPrice(value); - public static PriceVariants::NewPlanBulkBPSPrice Create(Models::NewPlanBulkBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkBPSPrice value) => + new PriceVariants::NewPlanBulkBPSPrice(value); - public static PriceVariants::NewPlanBulkPrice Create(Models::NewPlanBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewPlanBulkPrice value) => + new PriceVariants::NewPlanBulkPrice(value); - public static PriceVariants::NewPlanThresholdTotalAmountPrice Create( - Models::NewPlanThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanThresholdTotalAmountPrice value) => + new PriceVariants::NewPlanThresholdTotalAmountPrice(value); - public static PriceVariants::NewPlanTieredPackagePrice Create( - Models::NewPlanTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackagePrice value) => + new PriceVariants::NewPlanTieredPackagePrice(value); - public static PriceVariants::NewPlanTieredWithMinimumPrice Create( - Models::NewPlanTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredWithMinimumPrice value) => + new PriceVariants::NewPlanTieredWithMinimumPrice(value); - public static PriceVariants::NewPlanUnitWithPercentPrice Create( - Models::NewPlanUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithPercentPrice value) => + new PriceVariants::NewPlanUnitWithPercentPrice(value); - public static PriceVariants::NewPlanPackageWithAllocationPrice Create( - Models::NewPlanPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanPackageWithAllocationPrice value) => + new PriceVariants::NewPlanPackageWithAllocationPrice(value); - public static PriceVariants::NewPlanTierWithProrationPrice Create( - Models::NewPlanTierWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTierWithProrationPrice value) => + new PriceVariants::NewPlanTierWithProrationPrice(value); - public static PriceVariants::NewPlanUnitWithProrationPrice Create( - Models::NewPlanUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanUnitWithProrationPrice value) => + new PriceVariants::NewPlanUnitWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedAllocationPrice Create( - Models::NewPlanGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedAllocationPrice value) => + new PriceVariants::NewPlanGroupedAllocationPrice(value); - public static PriceVariants::NewPlanGroupedWithProratedMinimumPrice Create( - Models::NewPlanGroupedWithProratedMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithProratedMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewPlanGroupedWithMeteredMinimumPrice Create( - Models::NewPlanGroupedWithMeteredMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedWithMeteredMinimumPrice value) => + new PriceVariants::NewPlanGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithDisplayNamePrice Create( - Models::NewPlanMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithDisplayNamePrice value) => + new PriceVariants::NewPlanMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewPlanBulkWithProrationPrice Create( - Models::NewPlanBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanBulkWithProrationPrice value) => + new PriceVariants::NewPlanBulkWithProrationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPackagePrice Create( - Models::NewPlanGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPackagePrice value) => + new PriceVariants::NewPlanGroupedTieredPackagePrice(value); - public static PriceVariants::NewPlanMaxGroupTieredPackagePrice Create( - Models::NewPlanMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMaxGroupTieredPackagePrice value) => + new PriceVariants::NewPlanMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewPlanScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewPlanScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewPlanCumulativeGroupedBulkPrice Create( - Models::NewPlanCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanCumulativeGroupedBulkPrice value) => + new PriceVariants::NewPlanCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewPlanTieredPackageWithMinimumPrice Create( - Models::NewPlanTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanTieredPackageWithMinimumPrice value) => + new PriceVariants::NewPlanTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewPlanMatrixWithAllocationPrice Create( - Models::NewPlanMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanMatrixWithAllocationPrice value) => + new PriceVariants::NewPlanMatrixWithAllocationPrice(value); - public static PriceVariants::NewPlanGroupedTieredPrice Create( - Models::NewPlanGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewPlanGroupedTieredPrice value) => + new PriceVariants::NewPlanGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Plans/PlanProperties/Adjustment.cs b/src/Orb/Models/Plans/PlanProperties/Adjustment.cs index 85e5a339f..76fcac818 100644 --- a/src/Orb/Models/Plans/PlanProperties/Adjustment.cs +++ b/src/Orb/Models/Plans/PlanProperties/Adjustment.cs @@ -10,25 +10,21 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::PlanPhaseUsageDiscountAdjustment Create( - Models::PlanPhaseUsageDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseUsageDiscountAdjustment value) => + new AdjustmentVariants::PlanPhaseUsageDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhaseAmountDiscountAdjustment Create( - Models::PlanPhaseAmountDiscountAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseAmountDiscountAdjustment value) => + new AdjustmentVariants::PlanPhaseAmountDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhasePercentageDiscountAdjustment Create( + public static implicit operator Adjustment( Models::PlanPhasePercentageDiscountAdjustment value - ) => new(value); + ) => new AdjustmentVariants::PlanPhasePercentageDiscountAdjustment(value); - public static AdjustmentVariants::PlanPhaseMinimumAdjustment Create( - Models::PlanPhaseMinimumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseMinimumAdjustment value) => + new AdjustmentVariants::PlanPhaseMinimumAdjustment(value); - public static AdjustmentVariants::PlanPhaseMaximumAdjustment Create( - Models::PlanPhaseMaximumAdjustment value - ) => new(value); + public static implicit operator Adjustment(Models::PlanPhaseMaximumAdjustment value) => + new AdjustmentVariants::PlanPhaseMaximumAdjustment(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Price.cs b/src/Orb/Models/Price.cs index 046cca688..0187aec88 100644 --- a/src/Orb/Models/Price.cs +++ b/src/Orb/Models/Price.cs @@ -21,102 +21,92 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::Unit Create(PriceProperties::Unit value) => new(value); + public static implicit operator Price(PriceProperties::Unit value) => + new PriceVariants::Unit(value); - public static PriceVariants::Package Create(PriceProperties::Package value) => new(value); + public static implicit operator Price(PriceProperties::Package value) => + new PriceVariants::Package(value); - public static PriceVariants::Matrix Create(PriceProperties::Matrix value) => new(value); + public static implicit operator Price(PriceProperties::Matrix value) => + new PriceVariants::Matrix(value); - public static PriceVariants::Tiered Create(PriceProperties::Tiered value) => new(value); + public static implicit operator Price(PriceProperties::Tiered value) => + new PriceVariants::Tiered(value); - public static PriceVariants::TieredBPS Create(PriceProperties::TieredBPS value) => new(value); + public static implicit operator Price(PriceProperties::TieredBPS value) => + new PriceVariants::TieredBPS(value); - public static PriceVariants::BPS Create(PriceProperties::BPS value) => new(value); + public static implicit operator Price(PriceProperties::BPS value) => + new PriceVariants::BPS(value); - public static PriceVariants::BulkBPS Create(PriceProperties::BulkBPS value) => new(value); + public static implicit operator Price(PriceProperties::BulkBPS value) => + new PriceVariants::BulkBPS(value); - public static PriceVariants::Bulk Create(PriceProperties::Bulk value) => new(value); + public static implicit operator Price(PriceProperties::Bulk value) => + new PriceVariants::Bulk(value); - public static PriceVariants::ThresholdTotalAmount Create( - PriceProperties::ThresholdTotalAmount value - ) => new(value); + public static implicit operator Price(PriceProperties::ThresholdTotalAmount value) => + new PriceVariants::ThresholdTotalAmount(value); - public static PriceVariants::TieredPackage Create(PriceProperties::TieredPackage value) => - new(value); + public static implicit operator Price(PriceProperties::TieredPackage value) => + new PriceVariants::TieredPackage(value); - public static PriceVariants::GroupedTiered Create(PriceProperties::GroupedTiered value) => - new(value); + public static implicit operator Price(PriceProperties::GroupedTiered value) => + new PriceVariants::GroupedTiered(value); - public static PriceVariants::TieredWithMinimum Create( - PriceProperties::TieredWithMinimum value - ) => new(value); + public static implicit operator Price(PriceProperties::TieredWithMinimum value) => + new PriceVariants::TieredWithMinimum(value); - public static PriceVariants::TieredPackageWithMinimum Create( - PriceProperties::TieredPackageWithMinimum value - ) => new(value); + public static implicit operator Price(PriceProperties::TieredPackageWithMinimum value) => + new PriceVariants::TieredPackageWithMinimum(value); - public static PriceVariants::PackageWithAllocation Create( - PriceProperties::PackageWithAllocation value - ) => new(value); + public static implicit operator Price(PriceProperties::PackageWithAllocation value) => + new PriceVariants::PackageWithAllocation(value); - public static PriceVariants::UnitWithPercent Create(PriceProperties::UnitWithPercent value) => - new(value); + public static implicit operator Price(PriceProperties::UnitWithPercent value) => + new PriceVariants::UnitWithPercent(value); - public static PriceVariants::MatrixWithAllocation Create( - PriceProperties::MatrixWithAllocation value - ) => new(value); + public static implicit operator Price(PriceProperties::MatrixWithAllocation value) => + new PriceVariants::MatrixWithAllocation(value); - public static PriceVariants::TieredWithProration Create( - PriceProperties::TieredWithProration value - ) => new(value); + public static implicit operator Price(PriceProperties::TieredWithProration value) => + new PriceVariants::TieredWithProration(value); - public static PriceVariants::UnitWithProration Create( - PriceProperties::UnitWithProration value - ) => new(value); + public static implicit operator Price(PriceProperties::UnitWithProration value) => + new PriceVariants::UnitWithProration(value); - public static PriceVariants::GroupedAllocation Create( - PriceProperties::GroupedAllocation value - ) => new(value); + public static implicit operator Price(PriceProperties::GroupedAllocation value) => + new PriceVariants::GroupedAllocation(value); - public static PriceVariants::GroupedWithProratedMinimum Create( - PriceProperties::GroupedWithProratedMinimum value - ) => new(value); + public static implicit operator Price(PriceProperties::GroupedWithProratedMinimum value) => + new PriceVariants::GroupedWithProratedMinimum(value); - public static PriceVariants::GroupedWithMeteredMinimum Create( - PriceProperties::GroupedWithMeteredMinimum value - ) => new(value); + public static implicit operator Price(PriceProperties::GroupedWithMeteredMinimum value) => + new PriceVariants::GroupedWithMeteredMinimum(value); - public static PriceVariants::MatrixWithDisplayName Create( - PriceProperties::MatrixWithDisplayName value - ) => new(value); + public static implicit operator Price(PriceProperties::MatrixWithDisplayName value) => + new PriceVariants::MatrixWithDisplayName(value); - public static PriceVariants::BulkWithProration Create( - PriceProperties::BulkWithProration value - ) => new(value); + public static implicit operator Price(PriceProperties::BulkWithProration value) => + new PriceVariants::BulkWithProration(value); - public static PriceVariants::GroupedTieredPackage Create( - PriceProperties::GroupedTieredPackage value - ) => new(value); + public static implicit operator Price(PriceProperties::GroupedTieredPackage value) => + new PriceVariants::GroupedTieredPackage(value); - public static PriceVariants::MaxGroupTieredPackage Create( - PriceProperties::MaxGroupTieredPackage value - ) => new(value); + public static implicit operator Price(PriceProperties::MaxGroupTieredPackage value) => + new PriceVariants::MaxGroupTieredPackage(value); - public static PriceVariants::ScalableMatrixWithUnitPricing Create( - PriceProperties::ScalableMatrixWithUnitPricing value - ) => new(value); + public static implicit operator Price(PriceProperties::ScalableMatrixWithUnitPricing value) => + new PriceVariants::ScalableMatrixWithUnitPricing(value); - public static PriceVariants::ScalableMatrixWithTieredPricing Create( - PriceProperties::ScalableMatrixWithTieredPricing value - ) => new(value); + public static implicit operator Price(PriceProperties::ScalableMatrixWithTieredPricing value) => + new PriceVariants::ScalableMatrixWithTieredPricing(value); - public static PriceVariants::CumulativeGroupedBulk Create( - PriceProperties::CumulativeGroupedBulk value - ) => new(value); + public static implicit operator Price(PriceProperties::CumulativeGroupedBulk value) => + new PriceVariants::CumulativeGroupedBulk(value); - public static PriceVariants::GroupedWithMinMaxThresholds Create( - PriceProperties::GroupedWithMinMaxThresholds value - ) => new(value); + public static implicit operator Price(PriceProperties::GroupedWithMinMaxThresholds value) => + new PriceVariants::GroupedWithMinMaxThresholds(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/BPS.cs b/src/Orb/Models/PriceProperties/BPS.cs index 856035b5b..2e5baf4b1 100644 --- a/src/Orb/Models/PriceProperties/BPS.cs +++ b/src/Orb/Models/PriceProperties/BPS.cs @@ -490,10 +490,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if (!this.ModelType.Equals(Json::JsonSerializer.Deserialize("\"bps\""))) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/BPSProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BPSProperties/ConversionRateConfig.cs index 5593bf570..13d0a5d42 100644 --- a/src/Orb/Models/PriceProperties/BPSProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/BPSProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/Bulk.cs b/src/Orb/Models/PriceProperties/Bulk.cs index 3c1a23c9f..14ef5aeca 100644 --- a/src/Orb/Models/PriceProperties/Bulk.cs +++ b/src/Orb/Models/PriceProperties/Bulk.cs @@ -490,10 +490,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if (!this.ModelType.Equals(Json::JsonSerializer.Deserialize("\"bulk\""))) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/BulkBPS.cs b/src/Orb/Models/PriceProperties/BulkBPS.cs index b1b420a1b..0ac6da091 100644 --- a/src/Orb/Models/PriceProperties/BulkBPS.cs +++ b/src/Orb/Models/PriceProperties/BulkBPS.cs @@ -492,14 +492,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"bulk_bps\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/BulkBPSProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BulkBPSProperties/ConversionRateConfig.cs index 33737790b..c6014eba0 100644 --- a/src/Orb/Models/PriceProperties/BulkBPSProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/BulkBPSProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/BulkProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BulkProperties/ConversionRateConfig.cs index dc62d8f98..e01415fb1 100644 --- a/src/Orb/Models/PriceProperties/BulkProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/BulkProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/BulkWithProration.cs b/src/Orb/Models/PriceProperties/BulkWithProration.cs index 427f59a94..8984eeadc 100644 --- a/src/Orb/Models/PriceProperties/BulkWithProration.cs +++ b/src/Orb/Models/PriceProperties/BulkWithProration.cs @@ -506,14 +506,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"bulk_with_proration\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ConversionRateConfig.cs index 4ba39b101..568556c97 100644 --- a/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs b/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs index b2a87ef5f..e53966335 100644 --- a/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs +++ b/src/Orb/Models/PriceProperties/CumulativeGroupedBulk.cs @@ -509,14 +509,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"cumulative_grouped_bulk\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ConversionRateConfig.cs index be3479ee3..5e24cf640 100644 --- a/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedAllocation.cs b/src/Orb/Models/PriceProperties/GroupedAllocation.cs index 1d1ed2868..5eb9e48cb 100644 --- a/src/Orb/Models/PriceProperties/GroupedAllocation.cs +++ b/src/Orb/Models/PriceProperties/GroupedAllocation.cs @@ -506,14 +506,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"grouped_allocation\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ConversionRateConfig.cs index 739e21b98..6d0536a76 100644 --- a/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedTiered.cs b/src/Orb/Models/PriceProperties/GroupedTiered.cs index ce7bbfb33..b8c3547de 100644 --- a/src/Orb/Models/PriceProperties/GroupedTiered.cs +++ b/src/Orb/Models/PriceProperties/GroupedTiered.cs @@ -503,14 +503,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"grouped_tiered\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs b/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs index 6ef5d7c63..758a28b57 100644 --- a/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs +++ b/src/Orb/Models/PriceProperties/GroupedTieredPackage.cs @@ -509,14 +509,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"grouped_tiered_package\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ConversionRateConfig.cs index 424c0ae96..7939e72d6 100644 --- a/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedTieredProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedTieredProperties/ConversionRateConfig.cs index a86b27c4c..3c0be1416 100644 --- a/src/Orb/Models/PriceProperties/GroupedTieredProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/GroupedTieredProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs index c0f75e82c..c41e682a5 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimum.cs @@ -509,16 +509,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize( - "\"grouped_with_metered_minimum\"" - ) - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ConversionRateConfig.cs index 8841c7928..c61dec6d2 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs index 9a3d02592..ce3384b91 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs @@ -512,16 +512,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize( - "\"grouped_with_min_max_thresholds\"" - ) - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs index e0696be82..4024b7fa3 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs index 4b8a09090..282776db7 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs @@ -510,16 +510,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize( - "\"grouped_with_prorated_minimum\"" - ) - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ConversionRateConfig.cs index 57c0fdd77..d44969a59 100644 --- a/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/Matrix.cs b/src/Orb/Models/PriceProperties/Matrix.cs index b58a49dbf..cc440c55e 100644 --- a/src/Orb/Models/PriceProperties/Matrix.cs +++ b/src/Orb/Models/PriceProperties/Matrix.cs @@ -492,14 +492,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"matrix\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/MatrixProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MatrixProperties/ConversionRateConfig.cs index a407b5091..f6025de07 100644 --- a/src/Orb/Models/PriceProperties/MatrixProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/MatrixProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs b/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs index c92c82829..7a4cad689 100644 --- a/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs +++ b/src/Orb/Models/PriceProperties/MatrixWithAllocation.cs @@ -505,14 +505,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"matrix_with_allocation\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ConversionRateConfig.cs index 047b18b7c..48a3c74ef 100644 --- a/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs b/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs index 7249261af..8e7f8c7a4 100644 --- a/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs +++ b/src/Orb/Models/PriceProperties/MatrixWithDisplayName.cs @@ -509,14 +509,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"matrix_with_display_name\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ConversionRateConfig.cs index e4cfe1c65..d665d4c5a 100644 --- a/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs b/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs index da2a8fe49..407c09e85 100644 --- a/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs +++ b/src/Orb/Models/PriceProperties/MaxGroupTieredPackage.cs @@ -509,14 +509,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"max_group_tiered_package\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ConversionRateConfig.cs index 47c5fc1bb..c0e953cd9 100644 --- a/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/Package.cs b/src/Orb/Models/PriceProperties/Package.cs index cb4470003..a07153a59 100644 --- a/src/Orb/Models/PriceProperties/Package.cs +++ b/src/Orb/Models/PriceProperties/Package.cs @@ -491,14 +491,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"package\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; this.PackageConfig.Validate(); _ = this.PlanPhaseOrder; diff --git a/src/Orb/Models/PriceProperties/PackageProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/PackageProperties/ConversionRateConfig.cs index 4243edfa6..7349322c8 100644 --- a/src/Orb/Models/PriceProperties/PackageProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/PackageProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/PackageWithAllocation.cs b/src/Orb/Models/PriceProperties/PackageWithAllocation.cs index cbcdc4dac..b581dfbe4 100644 --- a/src/Orb/Models/PriceProperties/PackageWithAllocation.cs +++ b/src/Orb/Models/PriceProperties/PackageWithAllocation.cs @@ -505,14 +505,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"package_with_allocation\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; foreach (var item in this.PackageWithAllocationConfig.Values) { diff --git a/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ConversionRateConfig.cs index 97d809344..0ba60a0e9 100644 --- a/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs index 9dc5eba50..b2af1daf7 100644 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs +++ b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricing.cs @@ -511,16 +511,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize( - "\"scalable_matrix_with_tiered_pricing\"" - ) - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ConversionRateConfig.cs index 1fe2fef89..07bbfd06d 100644 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs index 594677b47..de4009cba 100644 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs +++ b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricing.cs @@ -511,16 +511,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize( - "\"scalable_matrix_with_unit_pricing\"" - ) - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ConversionRateConfig.cs index 7ccdd530c..41e7bf5c6 100644 --- a/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs b/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs index 4ec7db58e..9ec3b9fc5 100644 --- a/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs +++ b/src/Orb/Models/PriceProperties/ThresholdTotalAmount.cs @@ -505,14 +505,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"threshold_total_amount\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ConversionRateConfig.cs index 4cf3e6d5c..44d59c724 100644 --- a/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/Tiered.cs b/src/Orb/Models/PriceProperties/Tiered.cs index 02ab25ac5..ad9317e54 100644 --- a/src/Orb/Models/PriceProperties/Tiered.cs +++ b/src/Orb/Models/PriceProperties/Tiered.cs @@ -491,14 +491,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"tiered\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/TieredBPS.cs b/src/Orb/Models/PriceProperties/TieredBPS.cs index 708ab379e..e1dcca006 100644 --- a/src/Orb/Models/PriceProperties/TieredBPS.cs +++ b/src/Orb/Models/PriceProperties/TieredBPS.cs @@ -494,14 +494,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"tiered_bps\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/TieredBPSProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredBPSProperties/ConversionRateConfig.cs index 3cd3d281a..0cf469a3c 100644 --- a/src/Orb/Models/PriceProperties/TieredBPSProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/TieredBPSProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/TieredPackage.cs b/src/Orb/Models/PriceProperties/TieredPackage.cs index 429a40bc0..fe345cb2c 100644 --- a/src/Orb/Models/PriceProperties/TieredPackage.cs +++ b/src/Orb/Models/PriceProperties/TieredPackage.cs @@ -499,14 +499,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"tiered_package\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/TieredPackageProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredPackageProperties/ConversionRateConfig.cs index 85ecd4a22..73b0aa348 100644 --- a/src/Orb/Models/PriceProperties/TieredPackageProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/TieredPackageProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs b/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs index 77d790c0e..c9d520edf 100644 --- a/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs +++ b/src/Orb/Models/PriceProperties/TieredPackageWithMinimum.cs @@ -505,16 +505,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize( - "\"tiered_package_with_minimum\"" - ) - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ConversionRateConfig.cs index 9e7887372..235d6dac6 100644 --- a/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/TieredProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredProperties/ConversionRateConfig.cs index ef1defbff..9ac14d197 100644 --- a/src/Orb/Models/PriceProperties/TieredProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/TieredProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/TieredWithMinimum.cs b/src/Orb/Models/PriceProperties/TieredWithMinimum.cs index ef539a2b8..805771b92 100644 --- a/src/Orb/Models/PriceProperties/TieredWithMinimum.cs +++ b/src/Orb/Models/PriceProperties/TieredWithMinimum.cs @@ -502,14 +502,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"tiered_with_minimum\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ConversionRateConfig.cs index 6a9c157f9..4c3c99e1a 100644 --- a/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/TieredWithProration.cs b/src/Orb/Models/PriceProperties/TieredWithProration.cs index a6f061246..55df0b4d8 100644 --- a/src/Orb/Models/PriceProperties/TieredWithProration.cs +++ b/src/Orb/Models/PriceProperties/TieredWithProration.cs @@ -502,14 +502,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"tiered_with_proration\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ConversionRateConfig.cs index eb14b5e4f..0839b83d4 100644 --- a/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/Unit.cs b/src/Orb/Models/PriceProperties/Unit.cs index 547d2382b..0df502372 100644 --- a/src/Orb/Models/PriceProperties/Unit.cs +++ b/src/Orb/Models/PriceProperties/Unit.cs @@ -489,10 +489,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if (!this.ModelType.Equals(Json::JsonSerializer.Deserialize("\"unit\""))) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/UnitProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/UnitProperties/ConversionRateConfig.cs index 8e155e6af..ebaea576f 100644 --- a/src/Orb/Models/PriceProperties/UnitProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/UnitProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/UnitWithPercent.cs b/src/Orb/Models/PriceProperties/UnitWithPercent.cs index 9e21f4e8f..322376f1d 100644 --- a/src/Orb/Models/PriceProperties/UnitWithPercent.cs +++ b/src/Orb/Models/PriceProperties/UnitWithPercent.cs @@ -502,14 +502,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"unit_with_percent\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ConversionRateConfig.cs index fd56fa266..4429dd249 100644 --- a/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/PriceProperties/UnitWithProration.cs b/src/Orb/Models/PriceProperties/UnitWithProration.cs index 9619fc358..c933a0c9f 100644 --- a/src/Orb/Models/PriceProperties/UnitWithProration.cs +++ b/src/Orb/Models/PriceProperties/UnitWithProration.cs @@ -502,14 +502,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - if ( - !this.ModelType.Equals( - Json::JsonSerializer.Deserialize("\"unit_with_proration\"") - ) - ) - { - throw new System::Exception(); - } _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); diff --git a/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ConversionRateConfig.cs index b1277b129..4329d203a 100644 --- a/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ConversionRateConfig.cs @@ -10,13 +10,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Prices/EvaluatePriceGroupProperties/GroupingValue.cs b/src/Orb/Models/Prices/EvaluatePriceGroupProperties/GroupingValue.cs index 2f44d6033..b2a1d6d6d 100644 --- a/src/Orb/Models/Prices/EvaluatePriceGroupProperties/GroupingValue.cs +++ b/src/Orb/Models/Prices/EvaluatePriceGroupProperties/GroupingValue.cs @@ -9,11 +9,14 @@ public abstract record class GroupingValue { internal GroupingValue() { } - public static GroupingValueVariants::UnionMember0 Create(string value) => new(value); + public static implicit operator GroupingValue(string value) => + new GroupingValueVariants::UnionMember0(value); - public static GroupingValueVariants::UnionMember1 Create(double value) => new(value); + public static implicit operator GroupingValue(double value) => + new GroupingValueVariants::UnionMember1(value); - public static GroupingValueVariants::UnionMember2 Create(bool value) => new(value); + public static implicit operator GroupingValue(bool value) => + new GroupingValueVariants::UnionMember2(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Prices/PriceCreateParamsProperties/Body.cs b/src/Orb/Models/Prices/PriceCreateParamsProperties/Body.cs index 80eefa190..4f51a69cb 100644 --- a/src/Orb/Models/Prices/PriceCreateParamsProperties/Body.cs +++ b/src/Orb/Models/Prices/PriceCreateParamsProperties/Body.cs @@ -10,114 +10,92 @@ public abstract record class Body { internal Body() { } - public static BodyVariants::NewFloatingUnitPrice Create(Models::NewFloatingUnitPrice value) => - new(value); + public static implicit operator Body(Models::NewFloatingUnitPrice value) => + new BodyVariants::NewFloatingUnitPrice(value); - public static BodyVariants::NewFloatingPackagePrice Create( - Models::NewFloatingPackagePrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingPackagePrice value) => + new BodyVariants::NewFloatingPackagePrice(value); - public static BodyVariants::NewFloatingMatrixPrice Create( - Models::NewFloatingMatrixPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingMatrixPrice value) => + new BodyVariants::NewFloatingMatrixPrice(value); - public static BodyVariants::NewFloatingMatrixWithAllocationPrice Create( - Models::NewFloatingMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingMatrixWithAllocationPrice value) => + new BodyVariants::NewFloatingMatrixWithAllocationPrice(value); - public static BodyVariants::NewFloatingTieredPrice Create( - Models::NewFloatingTieredPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingTieredPrice value) => + new BodyVariants::NewFloatingTieredPrice(value); - public static BodyVariants::NewFloatingTieredBPSPrice Create( - Models::NewFloatingTieredBPSPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingTieredBPSPrice value) => + new BodyVariants::NewFloatingTieredBPSPrice(value); - public static BodyVariants::NewFloatingBPSPrice Create(Models::NewFloatingBPSPrice value) => - new(value); + public static implicit operator Body(Models::NewFloatingBPSPrice value) => + new BodyVariants::NewFloatingBPSPrice(value); - public static BodyVariants::NewFloatingBulkBPSPrice Create( - Models::NewFloatingBulkBPSPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingBulkBPSPrice value) => + new BodyVariants::NewFloatingBulkBPSPrice(value); - public static BodyVariants::NewFloatingBulkPrice Create(Models::NewFloatingBulkPrice value) => - new(value); + public static implicit operator Body(Models::NewFloatingBulkPrice value) => + new BodyVariants::NewFloatingBulkPrice(value); - public static BodyVariants::NewFloatingThresholdTotalAmountPrice Create( - Models::NewFloatingThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingThresholdTotalAmountPrice value) => + new BodyVariants::NewFloatingThresholdTotalAmountPrice(value); - public static BodyVariants::NewFloatingTieredPackagePrice Create( - Models::NewFloatingTieredPackagePrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingTieredPackagePrice value) => + new BodyVariants::NewFloatingTieredPackagePrice(value); - public static BodyVariants::NewFloatingGroupedTieredPrice Create( - Models::NewFloatingGroupedTieredPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingGroupedTieredPrice value) => + new BodyVariants::NewFloatingGroupedTieredPrice(value); - public static BodyVariants::NewFloatingMaxGroupTieredPackagePrice Create( - Models::NewFloatingMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingMaxGroupTieredPackagePrice value) => + new BodyVariants::NewFloatingMaxGroupTieredPackagePrice(value); - public static BodyVariants::NewFloatingTieredWithMinimumPrice Create( - Models::NewFloatingTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingTieredWithMinimumPrice value) => + new BodyVariants::NewFloatingTieredWithMinimumPrice(value); - public static BodyVariants::NewFloatingPackageWithAllocationPrice Create( - Models::NewFloatingPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingPackageWithAllocationPrice value) => + new BodyVariants::NewFloatingPackageWithAllocationPrice(value); - public static BodyVariants::NewFloatingTieredPackageWithMinimumPrice Create( - Models::NewFloatingTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingTieredPackageWithMinimumPrice value) => + new BodyVariants::NewFloatingTieredPackageWithMinimumPrice(value); - public static BodyVariants::NewFloatingUnitWithPercentPrice Create( - Models::NewFloatingUnitWithPercentPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingUnitWithPercentPrice value) => + new BodyVariants::NewFloatingUnitWithPercentPrice(value); - public static BodyVariants::NewFloatingTieredWithProrationPrice Create( - Models::NewFloatingTieredWithProrationPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingTieredWithProrationPrice value) => + new BodyVariants::NewFloatingTieredWithProrationPrice(value); - public static BodyVariants::NewFloatingUnitWithProrationPrice Create( - Models::NewFloatingUnitWithProrationPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingUnitWithProrationPrice value) => + new BodyVariants::NewFloatingUnitWithProrationPrice(value); - public static BodyVariants::NewFloatingGroupedAllocationPrice Create( - Models::NewFloatingGroupedAllocationPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingGroupedAllocationPrice value) => + new BodyVariants::NewFloatingGroupedAllocationPrice(value); - public static BodyVariants::NewFloatingGroupedWithProratedMinimumPrice Create( + public static implicit operator Body( Models::NewFloatingGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new BodyVariants::NewFloatingGroupedWithProratedMinimumPrice(value); - public static BodyVariants::NewFloatingGroupedWithMeteredMinimumPrice Create( - Models::NewFloatingGroupedWithMeteredMinimumPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingGroupedWithMeteredMinimumPrice value) => + new BodyVariants::NewFloatingGroupedWithMeteredMinimumPrice(value); - public static BodyVariants::NewFloatingMatrixWithDisplayNamePrice Create( - Models::NewFloatingMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingMatrixWithDisplayNamePrice value) => + new BodyVariants::NewFloatingMatrixWithDisplayNamePrice(value); - public static BodyVariants::NewFloatingBulkWithProrationPrice Create( - Models::NewFloatingBulkWithProrationPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingBulkWithProrationPrice value) => + new BodyVariants::NewFloatingBulkWithProrationPrice(value); - public static BodyVariants::NewFloatingGroupedTieredPackagePrice Create( - Models::NewFloatingGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingGroupedTieredPackagePrice value) => + new BodyVariants::NewFloatingGroupedTieredPackagePrice(value); - public static BodyVariants::NewFloatingScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Body( Models::NewFloatingScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new BodyVariants::NewFloatingScalableMatrixWithUnitPricingPrice(value); - public static BodyVariants::NewFloatingScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Body( Models::NewFloatingScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new BodyVariants::NewFloatingScalableMatrixWithTieredPricingPrice(value); - public static BodyVariants::NewFloatingCumulativeGroupedBulkPrice Create( - Models::NewFloatingCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Body(Models::NewFloatingCumulativeGroupedBulkPrice value) => + new BodyVariants::NewFloatingCumulativeGroupedBulkPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Prices/PriceEvaluateMultipleParamsProperties/PriceEvaluationProperties/Price.cs b/src/Orb/Models/Prices/PriceEvaluateMultipleParamsProperties/PriceEvaluationProperties/Price.cs index eeee512e9..b1632ad0f 100644 --- a/src/Orb/Models/Prices/PriceEvaluateMultipleParamsProperties/PriceEvaluationProperties/Price.cs +++ b/src/Orb/Models/Prices/PriceEvaluateMultipleParamsProperties/PriceEvaluationProperties/Price.cs @@ -14,114 +14,93 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewFloatingUnitPrice Create(Models::NewFloatingUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingUnitPrice value) => + new PriceVariants::NewFloatingUnitPrice(value); - public static PriceVariants::NewFloatingPackagePrice Create( - Models::NewFloatingPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingPackagePrice value) => + new PriceVariants::NewFloatingPackagePrice(value); - public static PriceVariants::NewFloatingMatrixPrice Create( - Models::NewFloatingMatrixPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixPrice value) => + new PriceVariants::NewFloatingMatrixPrice(value); - public static PriceVariants::NewFloatingMatrixWithAllocationPrice Create( - Models::NewFloatingMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixWithAllocationPrice value) => + new PriceVariants::NewFloatingMatrixWithAllocationPrice(value); - public static PriceVariants::NewFloatingTieredPrice Create( - Models::NewFloatingTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPrice value) => + new PriceVariants::NewFloatingTieredPrice(value); - public static PriceVariants::NewFloatingTieredBPSPrice Create( - Models::NewFloatingTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredBPSPrice value) => + new PriceVariants::NewFloatingTieredBPSPrice(value); - public static PriceVariants::NewFloatingBPSPrice Create(Models::NewFloatingBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingBPSPrice value) => + new PriceVariants::NewFloatingBPSPrice(value); - public static PriceVariants::NewFloatingBulkBPSPrice Create( - Models::NewFloatingBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingBulkBPSPrice value) => + new PriceVariants::NewFloatingBulkBPSPrice(value); - public static PriceVariants::NewFloatingBulkPrice Create(Models::NewFloatingBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingBulkPrice value) => + new PriceVariants::NewFloatingBulkPrice(value); - public static PriceVariants::NewFloatingThresholdTotalAmountPrice Create( - Models::NewFloatingThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingThresholdTotalAmountPrice value) => + new PriceVariants::NewFloatingThresholdTotalAmountPrice(value); - public static PriceVariants::NewFloatingTieredPackagePrice Create( - Models::NewFloatingTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPackagePrice value) => + new PriceVariants::NewFloatingTieredPackagePrice(value); - public static PriceVariants::NewFloatingGroupedTieredPrice Create( - Models::NewFloatingGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedTieredPrice value) => + new PriceVariants::NewFloatingGroupedTieredPrice(value); - public static PriceVariants::NewFloatingMaxGroupTieredPackagePrice Create( - Models::NewFloatingMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMaxGroupTieredPackagePrice value) => + new PriceVariants::NewFloatingMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewFloatingTieredWithMinimumPrice Create( - Models::NewFloatingTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredWithMinimumPrice value) => + new PriceVariants::NewFloatingTieredWithMinimumPrice(value); - public static PriceVariants::NewFloatingPackageWithAllocationPrice Create( - Models::NewFloatingPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingPackageWithAllocationPrice value) => + new PriceVariants::NewFloatingPackageWithAllocationPrice(value); - public static PriceVariants::NewFloatingTieredPackageWithMinimumPrice Create( - Models::NewFloatingTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPackageWithMinimumPrice value) => + new PriceVariants::NewFloatingTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewFloatingUnitWithPercentPrice Create( - Models::NewFloatingUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingUnitWithPercentPrice value) => + new PriceVariants::NewFloatingUnitWithPercentPrice(value); - public static PriceVariants::NewFloatingTieredWithProrationPrice Create( - Models::NewFloatingTieredWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredWithProrationPrice value) => + new PriceVariants::NewFloatingTieredWithProrationPrice(value); - public static PriceVariants::NewFloatingUnitWithProrationPrice Create( - Models::NewFloatingUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingUnitWithProrationPrice value) => + new PriceVariants::NewFloatingUnitWithProrationPrice(value); - public static PriceVariants::NewFloatingGroupedAllocationPrice Create( - Models::NewFloatingGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedAllocationPrice value) => + new PriceVariants::NewFloatingGroupedAllocationPrice(value); - public static PriceVariants::NewFloatingGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Models::NewFloatingGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewFloatingGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Models::NewFloatingGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewFloatingMatrixWithDisplayNamePrice Create( - Models::NewFloatingMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixWithDisplayNamePrice value) => + new PriceVariants::NewFloatingMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewFloatingBulkWithProrationPrice Create( - Models::NewFloatingBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingBulkWithProrationPrice value) => + new PriceVariants::NewFloatingBulkWithProrationPrice(value); - public static PriceVariants::NewFloatingGroupedTieredPackagePrice Create( - Models::NewFloatingGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedTieredPackagePrice value) => + new PriceVariants::NewFloatingGroupedTieredPackagePrice(value); - public static PriceVariants::NewFloatingScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewFloatingScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewFloatingScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewFloatingScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewFloatingCumulativeGroupedBulkPrice Create( - Models::NewFloatingCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingCumulativeGroupedBulkPrice value) => + new PriceVariants::NewFloatingCumulativeGroupedBulkPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Prices/PriceEvaluatePreviewEventsParamsProperties/PriceEvaluationProperties/Price.cs b/src/Orb/Models/Prices/PriceEvaluatePreviewEventsParamsProperties/PriceEvaluationProperties/Price.cs index 9d86d2c46..df566f957 100644 --- a/src/Orb/Models/Prices/PriceEvaluatePreviewEventsParamsProperties/PriceEvaluationProperties/Price.cs +++ b/src/Orb/Models/Prices/PriceEvaluatePreviewEventsParamsProperties/PriceEvaluationProperties/Price.cs @@ -14,114 +14,93 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewFloatingUnitPrice Create(Models::NewFloatingUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingUnitPrice value) => + new PriceVariants::NewFloatingUnitPrice(value); - public static PriceVariants::NewFloatingPackagePrice Create( - Models::NewFloatingPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingPackagePrice value) => + new PriceVariants::NewFloatingPackagePrice(value); - public static PriceVariants::NewFloatingMatrixPrice Create( - Models::NewFloatingMatrixPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixPrice value) => + new PriceVariants::NewFloatingMatrixPrice(value); - public static PriceVariants::NewFloatingMatrixWithAllocationPrice Create( - Models::NewFloatingMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixWithAllocationPrice value) => + new PriceVariants::NewFloatingMatrixWithAllocationPrice(value); - public static PriceVariants::NewFloatingTieredPrice Create( - Models::NewFloatingTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPrice value) => + new PriceVariants::NewFloatingTieredPrice(value); - public static PriceVariants::NewFloatingTieredBPSPrice Create( - Models::NewFloatingTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredBPSPrice value) => + new PriceVariants::NewFloatingTieredBPSPrice(value); - public static PriceVariants::NewFloatingBPSPrice Create(Models::NewFloatingBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingBPSPrice value) => + new PriceVariants::NewFloatingBPSPrice(value); - public static PriceVariants::NewFloatingBulkBPSPrice Create( - Models::NewFloatingBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingBulkBPSPrice value) => + new PriceVariants::NewFloatingBulkBPSPrice(value); - public static PriceVariants::NewFloatingBulkPrice Create(Models::NewFloatingBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingBulkPrice value) => + new PriceVariants::NewFloatingBulkPrice(value); - public static PriceVariants::NewFloatingThresholdTotalAmountPrice Create( - Models::NewFloatingThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingThresholdTotalAmountPrice value) => + new PriceVariants::NewFloatingThresholdTotalAmountPrice(value); - public static PriceVariants::NewFloatingTieredPackagePrice Create( - Models::NewFloatingTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPackagePrice value) => + new PriceVariants::NewFloatingTieredPackagePrice(value); - public static PriceVariants::NewFloatingGroupedTieredPrice Create( - Models::NewFloatingGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedTieredPrice value) => + new PriceVariants::NewFloatingGroupedTieredPrice(value); - public static PriceVariants::NewFloatingMaxGroupTieredPackagePrice Create( - Models::NewFloatingMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMaxGroupTieredPackagePrice value) => + new PriceVariants::NewFloatingMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewFloatingTieredWithMinimumPrice Create( - Models::NewFloatingTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredWithMinimumPrice value) => + new PriceVariants::NewFloatingTieredWithMinimumPrice(value); - public static PriceVariants::NewFloatingPackageWithAllocationPrice Create( - Models::NewFloatingPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingPackageWithAllocationPrice value) => + new PriceVariants::NewFloatingPackageWithAllocationPrice(value); - public static PriceVariants::NewFloatingTieredPackageWithMinimumPrice Create( - Models::NewFloatingTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPackageWithMinimumPrice value) => + new PriceVariants::NewFloatingTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewFloatingUnitWithPercentPrice Create( - Models::NewFloatingUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingUnitWithPercentPrice value) => + new PriceVariants::NewFloatingUnitWithPercentPrice(value); - public static PriceVariants::NewFloatingTieredWithProrationPrice Create( - Models::NewFloatingTieredWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredWithProrationPrice value) => + new PriceVariants::NewFloatingTieredWithProrationPrice(value); - public static PriceVariants::NewFloatingUnitWithProrationPrice Create( - Models::NewFloatingUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingUnitWithProrationPrice value) => + new PriceVariants::NewFloatingUnitWithProrationPrice(value); - public static PriceVariants::NewFloatingGroupedAllocationPrice Create( - Models::NewFloatingGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedAllocationPrice value) => + new PriceVariants::NewFloatingGroupedAllocationPrice(value); - public static PriceVariants::NewFloatingGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Models::NewFloatingGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewFloatingGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Models::NewFloatingGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewFloatingMatrixWithDisplayNamePrice Create( - Models::NewFloatingMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixWithDisplayNamePrice value) => + new PriceVariants::NewFloatingMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewFloatingBulkWithProrationPrice Create( - Models::NewFloatingBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingBulkWithProrationPrice value) => + new PriceVariants::NewFloatingBulkWithProrationPrice(value); - public static PriceVariants::NewFloatingGroupedTieredPackagePrice Create( - Models::NewFloatingGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedTieredPackagePrice value) => + new PriceVariants::NewFloatingGroupedTieredPackagePrice(value); - public static PriceVariants::NewFloatingScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewFloatingScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewFloatingScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewFloatingScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewFloatingCumulativeGroupedBulkPrice Create( - Models::NewFloatingCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingCumulativeGroupedBulkPrice value) => + new PriceVariants::NewFloatingCumulativeGroupedBulkPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/SubscriptionChanges/MutatedSubscriptionProperties/DiscountInterval.cs b/src/Orb/Models/SubscriptionChanges/MutatedSubscriptionProperties/DiscountInterval.cs index 731942034..a9cea59f2 100644 --- a/src/Orb/Models/SubscriptionChanges/MutatedSubscriptionProperties/DiscountInterval.cs +++ b/src/Orb/Models/SubscriptionChanges/MutatedSubscriptionProperties/DiscountInterval.cs @@ -10,17 +10,14 @@ public abstract record class DiscountInterval { internal DiscountInterval() { } - public static DiscountIntervalVariants::AmountDiscountInterval Create( - Models::AmountDiscountInterval value - ) => new(value); + public static implicit operator DiscountInterval(Models::AmountDiscountInterval value) => + new DiscountIntervalVariants::AmountDiscountInterval(value); - public static DiscountIntervalVariants::PercentageDiscountInterval Create( - Models::PercentageDiscountInterval value - ) => new(value); + public static implicit operator DiscountInterval(Models::PercentageDiscountInterval value) => + new DiscountIntervalVariants::PercentageDiscountInterval(value); - public static DiscountIntervalVariants::UsageDiscountInterval Create( - Models::UsageDiscountInterval value - ) => new(value); + public static implicit operator DiscountInterval(Models::UsageDiscountInterval value) => + new DiscountIntervalVariants::UsageDiscountInterval(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionBPSPriceProperties/ConversionRateConfig.cs index caafd2fd4..721f498c1 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionBulkBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionBulkBPSPriceProperties/ConversionRateConfig.cs index da9563542..794ee06c9 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionBulkBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionBulkBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionBulkPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionBulkPriceProperties/ConversionRateConfig.cs index f6b5944b0..bb51203c5 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionBulkPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionBulkPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionBulkWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionBulkWithProrationPriceProperties/ConversionRateConfig.cs index 74c323491..76ae9a6ae 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionBulkWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionBulkWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs index 112e04d47..6c907be9f 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionCumulativeGroupedBulkPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedAllocationPriceProperties/ConversionRateConfig.cs index c1bf93bbb..997f298da 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPackagePriceProperties/ConversionRateConfig.cs index 8551d004d..f96a34856 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPriceProperties/ConversionRateConfig.cs index 8a1a67086..c54e945e9 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedTieredPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs index c144fe617..ad90b4886 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithMeteredMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs index 55dca9713..9662d3f76 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionGroupedWithProratedMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionMatrixPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionMatrixPriceProperties/ConversionRateConfig.cs index 1352094e9..dbc9a3157 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionMatrixPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionMatrixPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithAllocationPriceProperties/ConversionRateConfig.cs index 5b1439927..b1d47e2c6 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs index a7731b5dd..a3638d05e 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionMatrixWithDisplayNamePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs index 94edac4ed..1a2f4f12a 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionMaxGroupTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionPackagePriceProperties/ConversionRateConfig.cs index 963abd441..fd56671ae 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionPackageWithAllocationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionPackageWithAllocationPriceProperties/ConversionRateConfig.cs index c3e2c2651..ea895ff79 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionPackageWithAllocationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionPackageWithAllocationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs index cfbba907e..2ca968f1d 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithTieredPricingPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs index 534e12b34..0e8338382 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionScalableMatrixWithUnitPricingPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionThresholdTotalAmountPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionThresholdTotalAmountPriceProperties/ConversionRateConfig.cs index bff6b2508..7ed1c15a2 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionThresholdTotalAmountPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionThresholdTotalAmountPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionTierWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionTierWithProrationPriceProperties/ConversionRateConfig.cs index fb1cf4acd..4ecedf220 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionTierWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionTierWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionTieredBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionTieredBPSPriceProperties/ConversionRateConfig.cs index 016cf9174..00b3bffc0 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionTieredBPSPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionTieredBPSPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackagePriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackagePriceProperties/ConversionRateConfig.cs index 39d9c9d5a..9672c8d91 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackagePriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackagePriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs index 2e4adcaf6..53a5c9cc3 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionTieredPackageWithMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionTieredPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionTieredPriceProperties/ConversionRateConfig.cs index 739ecfca3..b91d6ce27 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionTieredPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionTieredPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionTieredWithMinimumPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionTieredWithMinimumPriceProperties/ConversionRateConfig.cs index c577c27ad..0f9014a8f 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionTieredWithMinimumPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionTieredWithMinimumPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionUnitPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionUnitPriceProperties/ConversionRateConfig.cs index 9a11e27ca..0ab5f2dc5 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionUnitPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionUnitPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithPercentPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithPercentPriceProperties/ConversionRateConfig.cs index 24fd5ef96..21ee41da4 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithPercentPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithPercentPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithProrationPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithProrationPriceProperties/ConversionRateConfig.cs index d1fc6acf2..d882029ad 100644 --- a/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithProrationPriceProperties/ConversionRateConfig.cs +++ b/src/Orb/Models/Subscriptions/NewSubscriptionUnitWithProrationPriceProperties/ConversionRateConfig.cs @@ -13,13 +13,12 @@ public abstract record class ConversionRateConfig { internal ConversionRateConfig() { } - public static ConversionRateConfigVariants::UnitConversionRateConfig Create( - Models::UnitConversionRateConfig value - ) => new(value); + public static implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); - public static ConversionRateConfigVariants::TieredConversionRateConfig Create( + public static implicit operator ConversionRateConfig( Models::TieredConversionRateConfig value - ) => new(value); + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddAdjustmentProperties/Adjustment.cs index ad97f7cbd..8987e26ed 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddPriceProperties/Price.cs b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddPriceProperties/Price.cs index d21a34a57..c0db29af8 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddPriceProperties/Price.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/AddPriceProperties/Price.cs @@ -13,117 +13,107 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewSubscriptionUnitPrice Create( - Subscriptions::NewSubscriptionUnitPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionUnitPrice value) => + new PriceVariants::NewSubscriptionUnitPrice(value); - public static PriceVariants::NewSubscriptionPackagePrice Create( - Subscriptions::NewSubscriptionPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionPackagePrice value) => + new PriceVariants::NewSubscriptionPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixPrice Create( - Subscriptions::NewSubscriptionMatrixPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionMatrixPrice value) => + new PriceVariants::NewSubscriptionMatrixPrice(value); - public static PriceVariants::NewSubscriptionTieredPrice Create( - Subscriptions::NewSubscriptionTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPrice value) => + new PriceVariants::NewSubscriptionTieredPrice(value); - public static PriceVariants::NewSubscriptionTieredBPSPrice Create( - Subscriptions::NewSubscriptionTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredBPSPrice value) => + new PriceVariants::NewSubscriptionTieredBPSPrice(value); - public static PriceVariants::NewSubscriptionBPSPrice Create( - Subscriptions::NewSubscriptionBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBPSPrice value) => + new PriceVariants::NewSubscriptionBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkBPSPrice Create( - Subscriptions::NewSubscriptionBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkBPSPrice value) => + new PriceVariants::NewSubscriptionBulkBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkPrice Create( - Subscriptions::NewSubscriptionBulkPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkPrice value) => + new PriceVariants::NewSubscriptionBulkPrice(value); - public static PriceVariants::NewSubscriptionThresholdTotalAmountPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionThresholdTotalAmountPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionThresholdTotalAmountPrice(value); - public static PriceVariants::NewSubscriptionTieredPackagePrice Create( - Subscriptions::NewSubscriptionTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPackagePrice value) => + new PriceVariants::NewSubscriptionTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionTieredWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionUnitWithPercentPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithPercentPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithPercentPrice(value); - public static PriceVariants::NewSubscriptionPackageWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionPackageWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionPackageWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTierWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTierWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTierWithProrationPrice(value); - public static PriceVariants::NewSubscriptionUnitWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithProrationPrice(value); - public static PriceVariants::NewSubscriptionGroupedAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedAllocationPrice(value); - public static PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewSubscriptionBulkWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionBulkWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionBulkWithProrationPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionCumulativeGroupedBulkPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMaxGroupTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithDisplayNamePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredPackageWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPrice Create( - Subscriptions::NewSubscriptionGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionGroupedTieredPrice value) => + new PriceVariants::NewSubscriptionGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs index 4fa9bdb7e..0aae3be32 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplacePriceProperties/Price.cs b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplacePriceProperties/Price.cs index 11ce3aec9..30a1b3e45 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplacePriceProperties/Price.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionCreateParamsProperties/ReplacePriceProperties/Price.cs @@ -13,117 +13,107 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewSubscriptionUnitPrice Create( - Subscriptions::NewSubscriptionUnitPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionUnitPrice value) => + new PriceVariants::NewSubscriptionUnitPrice(value); - public static PriceVariants::NewSubscriptionPackagePrice Create( - Subscriptions::NewSubscriptionPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionPackagePrice value) => + new PriceVariants::NewSubscriptionPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixPrice Create( - Subscriptions::NewSubscriptionMatrixPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionMatrixPrice value) => + new PriceVariants::NewSubscriptionMatrixPrice(value); - public static PriceVariants::NewSubscriptionTieredPrice Create( - Subscriptions::NewSubscriptionTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPrice value) => + new PriceVariants::NewSubscriptionTieredPrice(value); - public static PriceVariants::NewSubscriptionTieredBPSPrice Create( - Subscriptions::NewSubscriptionTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredBPSPrice value) => + new PriceVariants::NewSubscriptionTieredBPSPrice(value); - public static PriceVariants::NewSubscriptionBPSPrice Create( - Subscriptions::NewSubscriptionBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBPSPrice value) => + new PriceVariants::NewSubscriptionBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkBPSPrice Create( - Subscriptions::NewSubscriptionBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkBPSPrice value) => + new PriceVariants::NewSubscriptionBulkBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkPrice Create( - Subscriptions::NewSubscriptionBulkPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkPrice value) => + new PriceVariants::NewSubscriptionBulkPrice(value); - public static PriceVariants::NewSubscriptionThresholdTotalAmountPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionThresholdTotalAmountPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionThresholdTotalAmountPrice(value); - public static PriceVariants::NewSubscriptionTieredPackagePrice Create( - Subscriptions::NewSubscriptionTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPackagePrice value) => + new PriceVariants::NewSubscriptionTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionTieredWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionUnitWithPercentPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithPercentPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithPercentPrice(value); - public static PriceVariants::NewSubscriptionPackageWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionPackageWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionPackageWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTierWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTierWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTierWithProrationPrice(value); - public static PriceVariants::NewSubscriptionUnitWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithProrationPrice(value); - public static PriceVariants::NewSubscriptionGroupedAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedAllocationPrice(value); - public static PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewSubscriptionBulkWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionBulkWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionBulkWithProrationPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionCumulativeGroupedBulkPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMaxGroupTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithDisplayNamePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredPackageWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPrice Create( - Subscriptions::NewSubscriptionGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionGroupedTieredPrice value) => + new PriceVariants::NewSubscriptionGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/Adjustment.cs index b2bdd274f..0cd483cbc 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/EndDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/EndDate.cs index 7c401c1ed..bfea610d2 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/EndDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/EndDate.cs @@ -17,11 +17,11 @@ public abstract record class EndDate { internal EndDate() { } - public static EndDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator EndDate(System::DateTime value) => + new EndDateVariants::DateTime(value); - public static EndDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator EndDate(Models::BillingCycleRelativeDate value) => + new EndDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/StartDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/StartDate.cs index cee0595c5..d296e538b 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/StartDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddAdjustmentProperties/StartDate.cs @@ -17,11 +17,11 @@ public abstract record class StartDate { internal StartDate() { } - public static StartDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator StartDate(System::DateTime value) => + new StartDateVariants::DateTime(value); - public static StartDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator StartDate(Models::BillingCycleRelativeDate value) => + new StartDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Discount.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Discount.cs index 011e56fba..38a76c920 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Discount.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Discount.cs @@ -10,12 +10,14 @@ public abstract record class Discount { internal Discount() { } - public static DiscountVariants::Amount Create(DiscountProperties::Amount value) => new(value); + public static implicit operator Discount(DiscountProperties::Amount value) => + new DiscountVariants::Amount(value); - public static DiscountVariants::Percentage Create(DiscountProperties::Percentage value) => - new(value); + public static implicit operator Discount(DiscountProperties::Percentage value) => + new DiscountVariants::Percentage(value); - public static DiscountVariants::Usage Create(DiscountProperties::Usage value) => new(value); + public static implicit operator Discount(DiscountProperties::Usage value) => + new DiscountVariants::Usage(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs index 9f102457a..d05331d7c 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Amount.cs @@ -46,14 +46,6 @@ public required double AmountDiscount public override void Validate() { _ = this.AmountDiscount; - if ( - !this.DiscountType.Equals( - Json::JsonSerializer.Deserialize("\"amount\"") - ) - ) - { - throw new System::Exception(); - } } public Amount() diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs index c1d39f829..6f72a0ad0 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Percentage.cs @@ -49,14 +49,6 @@ public required double PercentageDiscount public override void Validate() { - if ( - !this.DiscountType.Equals( - Json::JsonSerializer.Deserialize("\"percentage\"") - ) - ) - { - throw new System::Exception(); - } _ = this.PercentageDiscount; } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs index 041e259d4..ad967b1af 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/DiscountProperties/Usage.cs @@ -46,14 +46,6 @@ public required double UsageDiscount public override void Validate() { - if ( - !this.DiscountType.Equals( - Json::JsonSerializer.Deserialize("\"usage\"") - ) - ) - { - throw new System::Exception(); - } _ = this.UsageDiscount; } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/EndDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/EndDate.cs index b69f5afa9..5e3827700 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/EndDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/EndDate.cs @@ -15,11 +15,11 @@ public abstract record class EndDate { internal EndDate() { } - public static EndDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator EndDate(System::DateTime value) => + new EndDateVariants::DateTime(value); - public static EndDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator EndDate(Models::BillingCycleRelativeDate value) => + new EndDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Price.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Price.cs index 50ff632cd..0e9694817 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Price.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/Price.cs @@ -13,114 +13,93 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewFloatingUnitPrice Create(Models::NewFloatingUnitPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingUnitPrice value) => + new PriceVariants::NewFloatingUnitPrice(value); - public static PriceVariants::NewFloatingPackagePrice Create( - Models::NewFloatingPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingPackagePrice value) => + new PriceVariants::NewFloatingPackagePrice(value); - public static PriceVariants::NewFloatingMatrixPrice Create( - Models::NewFloatingMatrixPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixPrice value) => + new PriceVariants::NewFloatingMatrixPrice(value); - public static PriceVariants::NewFloatingMatrixWithAllocationPrice Create( - Models::NewFloatingMatrixWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixWithAllocationPrice value) => + new PriceVariants::NewFloatingMatrixWithAllocationPrice(value); - public static PriceVariants::NewFloatingTieredPrice Create( - Models::NewFloatingTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPrice value) => + new PriceVariants::NewFloatingTieredPrice(value); - public static PriceVariants::NewFloatingTieredBPSPrice Create( - Models::NewFloatingTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredBPSPrice value) => + new PriceVariants::NewFloatingTieredBPSPrice(value); - public static PriceVariants::NewFloatingBPSPrice Create(Models::NewFloatingBPSPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingBPSPrice value) => + new PriceVariants::NewFloatingBPSPrice(value); - public static PriceVariants::NewFloatingBulkBPSPrice Create( - Models::NewFloatingBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingBulkBPSPrice value) => + new PriceVariants::NewFloatingBulkBPSPrice(value); - public static PriceVariants::NewFloatingBulkPrice Create(Models::NewFloatingBulkPrice value) => - new(value); + public static implicit operator Price(Models::NewFloatingBulkPrice value) => + new PriceVariants::NewFloatingBulkPrice(value); - public static PriceVariants::NewFloatingThresholdTotalAmountPrice Create( - Models::NewFloatingThresholdTotalAmountPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingThresholdTotalAmountPrice value) => + new PriceVariants::NewFloatingThresholdTotalAmountPrice(value); - public static PriceVariants::NewFloatingTieredPackagePrice Create( - Models::NewFloatingTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPackagePrice value) => + new PriceVariants::NewFloatingTieredPackagePrice(value); - public static PriceVariants::NewFloatingGroupedTieredPrice Create( - Models::NewFloatingGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedTieredPrice value) => + new PriceVariants::NewFloatingGroupedTieredPrice(value); - public static PriceVariants::NewFloatingMaxGroupTieredPackagePrice Create( - Models::NewFloatingMaxGroupTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMaxGroupTieredPackagePrice value) => + new PriceVariants::NewFloatingMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewFloatingTieredWithMinimumPrice Create( - Models::NewFloatingTieredWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredWithMinimumPrice value) => + new PriceVariants::NewFloatingTieredWithMinimumPrice(value); - public static PriceVariants::NewFloatingPackageWithAllocationPrice Create( - Models::NewFloatingPackageWithAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingPackageWithAllocationPrice value) => + new PriceVariants::NewFloatingPackageWithAllocationPrice(value); - public static PriceVariants::NewFloatingTieredPackageWithMinimumPrice Create( - Models::NewFloatingTieredPackageWithMinimumPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredPackageWithMinimumPrice value) => + new PriceVariants::NewFloatingTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewFloatingUnitWithPercentPrice Create( - Models::NewFloatingUnitWithPercentPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingUnitWithPercentPrice value) => + new PriceVariants::NewFloatingUnitWithPercentPrice(value); - public static PriceVariants::NewFloatingTieredWithProrationPrice Create( - Models::NewFloatingTieredWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingTieredWithProrationPrice value) => + new PriceVariants::NewFloatingTieredWithProrationPrice(value); - public static PriceVariants::NewFloatingUnitWithProrationPrice Create( - Models::NewFloatingUnitWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingUnitWithProrationPrice value) => + new PriceVariants::NewFloatingUnitWithProrationPrice(value); - public static PriceVariants::NewFloatingGroupedAllocationPrice Create( - Models::NewFloatingGroupedAllocationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedAllocationPrice value) => + new PriceVariants::NewFloatingGroupedAllocationPrice(value); - public static PriceVariants::NewFloatingGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Models::NewFloatingGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewFloatingGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Models::NewFloatingGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewFloatingMatrixWithDisplayNamePrice Create( - Models::NewFloatingMatrixWithDisplayNamePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingMatrixWithDisplayNamePrice value) => + new PriceVariants::NewFloatingMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewFloatingBulkWithProrationPrice Create( - Models::NewFloatingBulkWithProrationPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingBulkWithProrationPrice value) => + new PriceVariants::NewFloatingBulkWithProrationPrice(value); - public static PriceVariants::NewFloatingGroupedTieredPackagePrice Create( - Models::NewFloatingGroupedTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingGroupedTieredPackagePrice value) => + new PriceVariants::NewFloatingGroupedTieredPackagePrice(value); - public static PriceVariants::NewFloatingScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Models::NewFloatingScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewFloatingScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Models::NewFloatingScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewFloatingScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewFloatingCumulativeGroupedBulkPrice Create( - Models::NewFloatingCumulativeGroupedBulkPrice value - ) => new(value); + public static implicit operator Price(Models::NewFloatingCumulativeGroupedBulkPrice value) => + new PriceVariants::NewFloatingCumulativeGroupedBulkPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/StartDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/StartDate.cs index 17a8cab11..f0f24ab5e 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/StartDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/StartDate.cs @@ -15,11 +15,11 @@ public abstract record class StartDate { internal StartDate() { } - public static StartDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator StartDate(System::DateTime value) => + new StartDateVariants::DateTime(value); - public static StartDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator StartDate(Models::BillingCycleRelativeDate value) => + new StartDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/EndDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/EndDate.cs index 20f5d933c..73c5e16ea 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/EndDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/EndDate.cs @@ -15,11 +15,11 @@ public abstract record class EndDate { internal EndDate() { } - public static EndDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator EndDate(System::DateTime value) => + new EndDateVariants::DateTime(value); - public static EndDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator EndDate(Models::BillingCycleRelativeDate value) => + new EndDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/StartDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/StartDate.cs index b1e7bfadc..1a08506d0 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/StartDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditAdjustmentProperties/StartDate.cs @@ -15,11 +15,11 @@ public abstract record class StartDate { internal StartDate() { } - public static StartDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator StartDate(System::DateTime value) => + new StartDateVariants::DateTime(value); - public static StartDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator StartDate(Models::BillingCycleRelativeDate value) => + new StartDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/EndDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/EndDate.cs index 1881c2535..db9dc1a13 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/EndDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/EndDate.cs @@ -15,11 +15,11 @@ public abstract record class EndDate { internal EndDate() { } - public static EndDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator EndDate(System::DateTime value) => + new EndDateVariants::DateTime(value); - public static EndDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator EndDate(Models::BillingCycleRelativeDate value) => + new EndDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/StartDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/StartDate.cs index 9e83938d9..91f9e6691 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/StartDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/EditProperties/StartDate.cs @@ -15,11 +15,11 @@ public abstract record class StartDate { internal StartDate() { } - public static StartDateVariants::DateTime Create(System::DateTime value) => new(value); + public static implicit operator StartDate(System::DateTime value) => + new StartDateVariants::DateTime(value); - public static StartDateVariants::BillingCycleRelativeDate Create( - Models::BillingCycleRelativeDate value - ) => new(value); + public static implicit operator StartDate(Models::BillingCycleRelativeDate value) => + new StartDateVariants::BillingCycleRelativeDate(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionProperties/DiscountInterval.cs b/src/Orb/Models/Subscriptions/SubscriptionProperties/DiscountInterval.cs index 91af98b20..dd2ec73c4 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionProperties/DiscountInterval.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionProperties/DiscountInterval.cs @@ -10,17 +10,14 @@ public abstract record class DiscountInterval { internal DiscountInterval() { } - public static DiscountIntervalVariants::AmountDiscountInterval Create( - Models::AmountDiscountInterval value - ) => new(value); + public static implicit operator DiscountInterval(Models::AmountDiscountInterval value) => + new DiscountIntervalVariants::AmountDiscountInterval(value); - public static DiscountIntervalVariants::PercentageDiscountInterval Create( - Models::PercentageDiscountInterval value - ) => new(value); + public static implicit operator DiscountInterval(Models::PercentageDiscountInterval value) => + new DiscountIntervalVariants::PercentageDiscountInterval(value); - public static DiscountIntervalVariants::UsageDiscountInterval Create( - Models::UsageDiscountInterval value - ) => new(value); + public static implicit operator DiscountInterval(Models::UsageDiscountInterval value) => + new DiscountIntervalVariants::UsageDiscountInterval(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddAdjustmentProperties/Adjustment.cs index 348ab66fe..b88d5205c 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddPriceProperties/Price.cs b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddPriceProperties/Price.cs index 5bfae5014..02dc7cce5 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddPriceProperties/Price.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/AddPriceProperties/Price.cs @@ -13,117 +13,107 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewSubscriptionUnitPrice Create( - Subscriptions::NewSubscriptionUnitPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionUnitPrice value) => + new PriceVariants::NewSubscriptionUnitPrice(value); - public static PriceVariants::NewSubscriptionPackagePrice Create( - Subscriptions::NewSubscriptionPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionPackagePrice value) => + new PriceVariants::NewSubscriptionPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixPrice Create( - Subscriptions::NewSubscriptionMatrixPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionMatrixPrice value) => + new PriceVariants::NewSubscriptionMatrixPrice(value); - public static PriceVariants::NewSubscriptionTieredPrice Create( - Subscriptions::NewSubscriptionTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPrice value) => + new PriceVariants::NewSubscriptionTieredPrice(value); - public static PriceVariants::NewSubscriptionTieredBPSPrice Create( - Subscriptions::NewSubscriptionTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredBPSPrice value) => + new PriceVariants::NewSubscriptionTieredBPSPrice(value); - public static PriceVariants::NewSubscriptionBPSPrice Create( - Subscriptions::NewSubscriptionBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBPSPrice value) => + new PriceVariants::NewSubscriptionBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkBPSPrice Create( - Subscriptions::NewSubscriptionBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkBPSPrice value) => + new PriceVariants::NewSubscriptionBulkBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkPrice Create( - Subscriptions::NewSubscriptionBulkPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkPrice value) => + new PriceVariants::NewSubscriptionBulkPrice(value); - public static PriceVariants::NewSubscriptionThresholdTotalAmountPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionThresholdTotalAmountPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionThresholdTotalAmountPrice(value); - public static PriceVariants::NewSubscriptionTieredPackagePrice Create( - Subscriptions::NewSubscriptionTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPackagePrice value) => + new PriceVariants::NewSubscriptionTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionTieredWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionUnitWithPercentPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithPercentPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithPercentPrice(value); - public static PriceVariants::NewSubscriptionPackageWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionPackageWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionPackageWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTierWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTierWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTierWithProrationPrice(value); - public static PriceVariants::NewSubscriptionUnitWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithProrationPrice(value); - public static PriceVariants::NewSubscriptionGroupedAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedAllocationPrice(value); - public static PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewSubscriptionBulkWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionBulkWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionBulkWithProrationPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionCumulativeGroupedBulkPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMaxGroupTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithDisplayNamePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredPackageWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPrice Create( - Subscriptions::NewSubscriptionGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionGroupedTieredPrice value) => + new PriceVariants::NewSubscriptionGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs index 1f41f5899..35acd2551 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplaceAdjustmentProperties/Adjustment.cs @@ -13,19 +13,20 @@ public abstract record class Adjustment { internal Adjustment() { } - public static AdjustmentVariants::NewPercentageDiscount Create( - Models::NewPercentageDiscount value - ) => new(value); + public static implicit operator Adjustment(Models::NewPercentageDiscount value) => + new AdjustmentVariants::NewPercentageDiscount(value); - public static AdjustmentVariants::NewUsageDiscount Create(Models::NewUsageDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewUsageDiscount value) => + new AdjustmentVariants::NewUsageDiscount(value); - public static AdjustmentVariants::NewAmountDiscount Create(Models::NewAmountDiscount value) => - new(value); + public static implicit operator Adjustment(Models::NewAmountDiscount value) => + new AdjustmentVariants::NewAmountDiscount(value); - public static AdjustmentVariants::NewMinimum Create(Models::NewMinimum value) => new(value); + public static implicit operator Adjustment(Models::NewMinimum value) => + new AdjustmentVariants::NewMinimum(value); - public static AdjustmentVariants::NewMaximum Create(Models::NewMaximum value) => new(value); + public static implicit operator Adjustment(Models::NewMaximum value) => + new AdjustmentVariants::NewMaximum(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplacePriceProperties/Price.cs b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplacePriceProperties/Price.cs index 2b0250063..7e5f5a313 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplacePriceProperties/Price.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionSchedulePlanChangeParamsProperties/ReplacePriceProperties/Price.cs @@ -13,117 +13,107 @@ public abstract record class Price { internal Price() { } - public static PriceVariants::NewSubscriptionUnitPrice Create( - Subscriptions::NewSubscriptionUnitPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionUnitPrice value) => + new PriceVariants::NewSubscriptionUnitPrice(value); - public static PriceVariants::NewSubscriptionPackagePrice Create( - Subscriptions::NewSubscriptionPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionPackagePrice value) => + new PriceVariants::NewSubscriptionPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixPrice Create( - Subscriptions::NewSubscriptionMatrixPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionMatrixPrice value) => + new PriceVariants::NewSubscriptionMatrixPrice(value); - public static PriceVariants::NewSubscriptionTieredPrice Create( - Subscriptions::NewSubscriptionTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPrice value) => + new PriceVariants::NewSubscriptionTieredPrice(value); - public static PriceVariants::NewSubscriptionTieredBPSPrice Create( - Subscriptions::NewSubscriptionTieredBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredBPSPrice value) => + new PriceVariants::NewSubscriptionTieredBPSPrice(value); - public static PriceVariants::NewSubscriptionBPSPrice Create( - Subscriptions::NewSubscriptionBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBPSPrice value) => + new PriceVariants::NewSubscriptionBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkBPSPrice Create( - Subscriptions::NewSubscriptionBulkBPSPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkBPSPrice value) => + new PriceVariants::NewSubscriptionBulkBPSPrice(value); - public static PriceVariants::NewSubscriptionBulkPrice Create( - Subscriptions::NewSubscriptionBulkPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionBulkPrice value) => + new PriceVariants::NewSubscriptionBulkPrice(value); - public static PriceVariants::NewSubscriptionThresholdTotalAmountPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionThresholdTotalAmountPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionThresholdTotalAmountPrice(value); - public static PriceVariants::NewSubscriptionTieredPackagePrice Create( - Subscriptions::NewSubscriptionTieredPackagePrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionTieredPackagePrice value) => + new PriceVariants::NewSubscriptionTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionTieredWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionUnitWithPercentPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithPercentPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithPercentPrice(value); - public static PriceVariants::NewSubscriptionPackageWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionPackageWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionPackageWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTierWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTierWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTierWithProrationPrice(value); - public static PriceVariants::NewSubscriptionUnitWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionUnitWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionUnitWithProrationPrice(value); - public static PriceVariants::NewSubscriptionGroupedAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedAllocationPrice(value); - public static PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithProratedMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithProratedMinimumPrice(value); - public static PriceVariants::NewSubscriptionBulkWithProrationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionBulkWithProrationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionBulkWithProrationPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithUnitPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithUnitPricingPrice(value); - public static PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionScalableMatrixWithTieredPricingPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionScalableMatrixWithTieredPricingPrice(value); - public static PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionCumulativeGroupedBulkPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionCumulativeGroupedBulkPrice(value); - public static PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMaxGroupTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMaxGroupTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedWithMeteredMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedWithMeteredMinimumPrice(value); - public static PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithDisplayNamePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithDisplayNamePrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPackagePrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionGroupedTieredPackagePrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionGroupedTieredPackagePrice(value); - public static PriceVariants::NewSubscriptionMatrixWithAllocationPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionMatrixWithAllocationPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionMatrixWithAllocationPrice(value); - public static PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice Create( + public static implicit operator Price( Subscriptions::NewSubscriptionTieredPackageWithMinimumPrice value - ) => new(value); + ) => new PriceVariants::NewSubscriptionTieredPackageWithMinimumPrice(value); - public static PriceVariants::NewSubscriptionGroupedTieredPrice Create( - Subscriptions::NewSubscriptionGroupedTieredPrice value - ) => new(value); + public static implicit operator Price(Subscriptions::NewSubscriptionGroupedTieredPrice value) => + new PriceVariants::NewSubscriptionGroupedTieredPrice(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionUpdateTrialParamsProperties/TrialEndDate.cs b/src/Orb/Models/Subscriptions/SubscriptionUpdateTrialParamsProperties/TrialEndDate.cs index f2a3d26aa..de38ed66e 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionUpdateTrialParamsProperties/TrialEndDate.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionUpdateTrialParamsProperties/TrialEndDate.cs @@ -15,11 +15,11 @@ public abstract record class TrialEndDate { internal TrialEndDate() { } - public static TrialEndDateVariants::UnionMember0 Create(System::DateTime value) => new(value); + public static implicit operator TrialEndDate(System::DateTime value) => + new TrialEndDateVariants::UnionMember0(value); - public static TrialEndDateVariants::UnionMember1 Create( - TrialEndDateProperties::UnionMember1 value - ) => new(value); + public static implicit operator TrialEndDate(TrialEndDateProperties::UnionMember1 value) => + new TrialEndDateVariants::UnionMember1(value); public abstract void Validate(); } diff --git a/src/Orb/Models/Subscriptions/SubscriptionUsage.cs b/src/Orb/Models/Subscriptions/SubscriptionUsage.cs index 737f08767..c82d16923 100644 --- a/src/Orb/Models/Subscriptions/SubscriptionUsage.cs +++ b/src/Orb/Models/Subscriptions/SubscriptionUsage.cs @@ -10,13 +10,13 @@ public abstract record class SubscriptionUsage { internal SubscriptionUsage() { } - public static SubscriptionUsageVariants::UngroupedSubscriptionUsage Create( + public static implicit operator SubscriptionUsage( SubscriptionUsageProperties::UngroupedSubscriptionUsage value - ) => new(value); + ) => new SubscriptionUsageVariants::UngroupedSubscriptionUsage(value); - public static SubscriptionUsageVariants::GroupedSubscriptionUsage Create( + public static implicit operator SubscriptionUsage( SubscriptionUsageProperties::GroupedSubscriptionUsage value - ) => new(value); + ) => new SubscriptionUsageVariants::GroupedSubscriptionUsage(value); public abstract void Validate(); } From 3eb9334def8a6d9e09154e9c3d606f42897379fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:22:13 +0000 Subject: [PATCH 09/10] feat(internal): generate release flow files --- .release-please-manifest.json | 3 ++ release-please-config.json | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..1332969bd --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..a4ee7a8a3 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "simple", + "extra-files": [ + "README.md" + ] +} \ No newline at end of file From a1be33b7150558507fb8adcbc513eb288eb9eb2f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:22:29 +0000 Subject: [PATCH 10/10] release: 0.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969bd..3d2ac0bdd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "0.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..b9bd2e10e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +## 0.1.0 (2025-07-29) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/orbcorp/orb-csharp/compare/v0.0.1...v0.1.0) + +### Features + +* **api:** add C# ([e2db41d](https://github.com/orbcorp/orb-csharp/commit/e2db41d4c0585fc2e3472df2a88a5be4cb2432fb)) +* **api:** api update ([b08df82](https://github.com/orbcorp/orb-csharp/commit/b08df824c44e6cc0ac72d42b07c3c089f501862d)) +* **api:** api update ([d0d1a79](https://github.com/orbcorp/orb-csharp/commit/d0d1a7995095b23506e98a0ba0e5bdb47370dc5f)) +* **api:** api update ([268fdab](https://github.com/orbcorp/orb-csharp/commit/268fdab77f42a6e87ffc2f7fd1863bbd05d30033)) +* **api:** api update ([7c7a621](https://github.com/orbcorp/orb-csharp/commit/7c7a621be47edaca08972e0986c72dab410ec052)) +* **client:** automatically set constants for user ([25e678a](https://github.com/orbcorp/orb-csharp/commit/25e678a352492d8119389201e754ffa1b96b85a0)) +* **client:** implement implicit union casts ([5a6d432](https://github.com/orbcorp/orb-csharp/commit/5a6d4322fd6e82838a22f6658a6252f0c76bf367)) +* **internal:** generate release flow files ([3eb9334](https://github.com/orbcorp/orb-csharp/commit/3eb9334def8a6d9e09154e9c3d606f42897379fa)) + + +### Documentation + +* note alpha status ([3167be0](https://github.com/orbcorp/orb-csharp/commit/3167be06e8e3929b18e0d4d6af09f69608e68515))