diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..3d2ac0bd --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 9450f45c..c03739d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-612316c13276a207f56e2e2c7bbc68f4bb73de85e3661595a23f23d9ccc80276.yml -openapi_spec_hash: 6e125f05e40521ec485edf6e15beec2e -config_hash: 8c9a47f104c777e2a1e8f3fad15c093b +configured_endpoints: 118 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml +openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025 +config_hash: 5135e9237207028f293049a77428c775 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..b9bd2e10 --- /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)) diff --git a/README.md b/README.md index 98a53c1d..237927bf 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). diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..a4ee7a8a --- /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 diff --git a/src/Orb.Tests/Service/Beta/BetaServiceTest.cs b/src/Orb.Tests/Service/Beta/BetaServiceTest.cs index 1cb8bc4a..ee3b1d68 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 8db84ab8..e5e680f6 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 3cd0d032..b8bf0c42 100644 --- a/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs +++ b/src/Orb.Tests/Service/Coupons/CouponServiceTest.cs @@ -1,7 +1,5 @@ -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; @@ -15,13 +13,7 @@ public class CouponServiceTest : Tests::TestBase var coupon = await this.client.Coupons.Create( new Coupons::CouponCreateParams() { - Discount = CouponCreateParamsProperties::Discount.Create( - new DiscountProperties::Percentage() - { - DiscountType = PercentageProperties::DiscountType.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 3d01de1c..87bc86a0 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,29 +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, - EntryType = IncrementProperties::EntryType.Increment, - 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(); @@ -81,29 +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, - EntryType = IncrementProperties1::EntryType.Increment, - 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 96dbc5fe..64b5e28f 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/DimensionalPriceGroups/DimensionalPriceGroupServiceTest.cs b/src/Orb.Tests/Service/DimensionalPriceGroups/DimensionalPriceGroupServiceTest.cs index 64882f8f..7672d349 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 204fb06e..f0f7da03 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.Tests/Service/Invoices/InvoiceServiceTest.cs b/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs index 39d6aed2..fd6ef13d 100644 --- a/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs +++ b/src/Orb.Tests/Service/Invoices/InvoiceServiceTest.cs @@ -34,29 +34,27 @@ public class InvoiceServiceTest : Tests::TestBase UnitConfig = new Models::UnitConfig() { UnitAmount = "unit_amount" }, }, ], - NetTerms = 0, 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" } }, + NetTerms = 0, WillAutoIssue = false, } ); diff --git a/src/Orb.Tests/Service/Plans/PlanServiceTest.cs b/src/Orb.Tests/Service/Plans/PlanServiceTest.cs index 88311583..ddda95cd 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 2ea6f903..7f720da6 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 3c6dffc8..193b4451 100644 --- a/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs +++ b/src/Orb.Tests/Service/Subscriptions/SubscriptionServiceTest.cs @@ -1,14 +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 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; -using EditAdjustmentProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.EditAdjustmentProperties; using EditProperties = Orb.Models.Subscriptions.SubscriptionPriceIntervalsParamsProperties.EditProperties; using Json = System.Text.Json; using Models = Orb.Models; @@ -17,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; @@ -31,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; @@ -52,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"), @@ -112,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"), }, @@ -221,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", }, ], @@ -279,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", }, ], @@ -475,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", @@ -490,19 +450,8 @@ public class SubscriptionServiceTest : Tests::TestBase }, ExpiresAtEndOfCadence = true, }, - Discounts = - [ - AddProperties::Discount.Create( - new DiscountProperties::Amount() - { - AmountDiscount = 0, - DiscountType = AmountProperties::DiscountType.Amount, - } - ), - ], - 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 = @@ -515,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() { - 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 = "h74gfhdjvn7ujokd", UsageCustomerIDs = ["string"], }, @@ -578,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, @@ -617,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 = [ @@ -629,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"], }, ], @@ -640,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"), }, ], } @@ -683,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"), @@ -743,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() + { + 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", StartDate = System::DateTime.Parse("2019-12-27T18:11:19.117Z"), }, @@ -845,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", }, ], @@ -903,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", }, ], @@ -1045,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 a58dae8b..0c4108c1 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 b5dcbf0c..8aec49d6 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 401cec51..4814650c 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 342e9fb1..9f6ab0df 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 237330c7..84bd47ec 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 bd9ab4ca..90635ce7 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 f1707164..9c519a36 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 55daca0c..002d22bf 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 cf41ed4e..2660472b 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 7912e29e..9113230a 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 c0b8fc77..bde26d74 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 60e4c6ce..51f60962 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,12 @@ public required string AmountDiscount public override void Validate() { _ = this.AmountDiscount; - this.DiscountType.Validate(); } - 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 29c8d648..00000000 --- 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 db105616..57e52e75 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,13 @@ public required double PercentageDiscount public override void Validate() { - this.DiscountType.Validate(); _ = 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 fd1a73b2..00000000 --- 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/Coupons/CouponProperties/Discount.cs b/src/Orb/Models/Coupons/CouponProperties/Discount.cs index 89cd34fa..1126053e 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/CustomerTaxID.cs b/src/Orb/Models/CustomerTaxID.cs index 4c9d3e69..2df80d9c 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 49c6cac3..7113440f 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 661d989d..ac5011c5 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/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/Body.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/Body.cs index 0b3c3e4d..6980c528 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 bf8f4f58..0defa507 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,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -131,7 +128,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 5d718f37..00000000 --- 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 bc513951..07bc3dc3 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,6 @@ public string? Description public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -111,7 +108,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 83266bfb..00000000 --- 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 29355e60..81e5ca0e 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,6 @@ public string? Description public override void Validate() { - this.EntryType.Validate(); _ = this.TargetExpiryDate; _ = this.Amount; _ = this.BlockID; @@ -164,7 +161,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 7c0399c7..00000000 --- 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 c759cc5e..8309684c 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,6 @@ public string? PerUnitCostBasis public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; _ = this.EffectiveDate; @@ -185,7 +183,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 7f047af8..00000000 --- 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/IncrementProperties/InvoiceSettings.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs index a5ca5439..37f9a59b 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/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs index 23b18551..3f65534c 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 6f3d1d36..50d37058 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,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -147,7 +145,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 a2868395..00000000 --- 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/LedgerCreateEntryByExternalIDResponse.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDResponse.cs index 1e3b2ce9..b28ebb19 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 cb0e525b..0cc2206b 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 2dd02dae..4bd2e7d8 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,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -131,7 +128,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 9efb1cbf..00000000 --- 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 854e870a..317a8013 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,6 @@ public string? Description public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -111,7 +108,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 a720a3de..00000000 --- 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 b89e3e03..e9d6a3b8 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,6 @@ public string? Description public override void Validate() { - this.EntryType.Validate(); _ = this.TargetExpiryDate; _ = this.Amount; _ = this.BlockID; @@ -164,7 +161,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 78e2b0a0..00000000 --- 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 b851597d..68374e98 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,6 @@ public string? PerUnitCostBasis public override void Validate() { _ = this.Amount; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; _ = this.EffectiveDate; @@ -185,7 +183,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 b7a800c7..00000000 --- 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/IncrementProperties/InvoiceSettings.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs index deca99ce..039969c4 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/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettingsProperties/InvoiceDate.cs index d9360435..09d33f6f 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 241e839d..4bcb490b 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,6 @@ public override void Validate() { _ = this.Amount; _ = this.BlockID; - this.EntryType.Validate(); _ = this.Currency; _ = this.Description; if (this.Metadata != null) @@ -147,7 +145,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 d1cfb757..00000000 --- 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/Customers/Credits/Ledger/LedgerCreateEntryResponse.cs b/src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryResponse.cs index 85cb64d2..c668c86f 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 4409f9a2..78ab6566 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 81b04ba8..302ee2b4 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/Customer.cs b/src/Orb/Models/Customers/Customer.cs index d9c71b39..7da3cdcb 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 79f899fb..287b0cf6 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/CustomerCreateParamsProperties/TaxConfiguration.cs b/src/Orb/Models/Customers/CustomerCreateParamsProperties/TaxConfiguration.cs index 33ced7ec..0f94bc74 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/CustomerUpdateByExternalIDParams.cs b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParams.cs index ab7c4766..000cd5fe 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 { @@ -335,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/CustomerUpdateByExternalIDParamsProperties/TaxConfiguration.cs b/src/Orb/Models/Customers/CustomerUpdateByExternalIDParamsProperties/TaxConfiguration.cs index d30dd455..aefb62ca 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/CustomerUpdateParams.cs b/src/Orb/Models/Customers/CustomerUpdateParams.cs index 8899481e..d3436476 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 { @@ -336,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/Customers/CustomerUpdateParamsProperties/TaxConfiguration.cs b/src/Orb/Models/Customers/CustomerUpdateParamsProperties/TaxConfiguration.cs index 338cf86e..10ae7722 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/DimensionalPriceGroups/DimensionalPriceGroupUpdateParams.cs b/src/Orb/Models/DimensionalPriceGroups/DimensionalPriceGroupUpdateParams.cs new file mode 100644 index 00000000..b432d20a --- /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 00000000..f1b3ed73 --- /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/Discount.cs b/src/Orb/Models/Discount.cs index 92b0dd33..edb984f8 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/Invoice.cs b/src/Orb/Models/Invoice.cs index e0339473..48483747 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/InvoiceLevelDiscount.cs b/src/Orb/Models/InvoiceLevelDiscount.cs index 849a5121..50c2d380 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 461f2f8a..072c8e8d 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 5f4d78a8..8ee6de81 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 0f8eec3e..858c8ffe 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 dcdb74f6..9e478961 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/InvoiceCreateParams.cs b/src/Orb/Models/Invoices/InvoiceCreateParams.cs index 3b995908..d19fca74 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. diff --git a/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponse.cs b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponse.cs index af6e54a5..f7515474 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/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/Adjustment.cs b/src/Orb/Models/Invoices/InvoiceFetchUpcomingResponseProperties/LineItemProperties/Adjustment.cs index 25df9180..94ab2570 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 1f8142e4..1153f335 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/Invoices/InvoiceUpdateParams.cs b/src/Orb/Models/Invoices/InvoiceUpdateParams.cs index ce5bb160..17f040a6 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/NewFloatingBPSPriceProperties/ConversionRateConfig.cs b/src/Orb/Models/NewFloatingBPSPriceProperties/ConversionRateConfig.cs index 50ce01aa..ada17ddd 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 e90ccfdc..42cb3ff4 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 bc69f853..9380ad7e 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 29bb42ef..9032f784 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 831bc792..7063af97 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 be94e14d..fe833429 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 311b7b37..fb4bb29c 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 fb6fc01a..5209f5eb 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 47a97402..1f4bafb0 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 56ad80ec..fd83917d 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 0f773837..d89a419e 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 8496f1dd..39900a8e 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 f09bb7e7..a9ca0bf6 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 f8f2c680..a1d9c331 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 e10a17c1..a10ea5c6 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 48666ecc..ded4b430 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 3761223a..d539dcfb 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 3caa82c9..d2f9cc72 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 d3c074bb..d14f45c9 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 46b74588..3e71f8be 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 7992c3f8..da57b5b8 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 f2198136..0b35fad3 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 b3a12991..285ecdf0 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 0610b148..f7050321 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 71fb7dc9..b6c7fb59 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 a07a6146..8c4d8910 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 922cfb2a..0297b0ac 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 a46202de..742ec428 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 c1fcdde2..1acd4a07 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 f1215e94..8ed868dc 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 4c8893da..81d2e731 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 55eedc4c..441efbe7 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 576958ee..f50948f7 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 b01958e8..80d28536 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 e5779638..1310f5c6 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 0b020c74..174baaa1 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 74a3aeb7..7204e850 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 19ff2e48..d16161af 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 3f2a4be4..d129d858 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 1b9ad410..741b8903 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 42005079..93e06c3d 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 2e58ffe7..f94010ea 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 bc06220b..3e1c4074 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 c21a0d18..fd3ffa5d 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 0accc1f3..1808c3ec 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 ba3f61b3..a025e5ae 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 0cbd035e..7955c383 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 d81309f3..c268a6be 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 d4f35159..cfbfa8ed 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 f60a21bf..076d8a52 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 b6423460..e5eb4318 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 1ca013e2..319332f7 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 340fd99a..75d8b467 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 06aafcd5..f1c74a89 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 6f493364..e9af85c9 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 d68d3453..549dfbd5 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 89aa6a52..c0c46cec 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 d0f2f60b..cce800c8 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 85e5a339..76fcac81 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 c70602d8..0187aec8 100644 --- a/src/Orb/Models/Price.cs +++ b/src/Orb/Models/Price.cs @@ -21,98 +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 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 9e37cf6a..2e5baf4b 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -499,7 +497,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BPSProperties/ConversionRateConfig.cs index 5593bf57..13d0a5d4 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/BPSProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BPSProperties/ModelType.cs deleted file mode 100644 index 4b294553..00000000 --- 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 c724cec2..14ef5aec 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -499,7 +497,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 b9ff5f5d..0ac6da09 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -501,7 +499,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BulkBPSProperties/ConversionRateConfig.cs index 33737790..c6014eba 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/BulkBPSProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BulkBPSProperties/ModelType.cs deleted file mode 100644 index 2bdf4cde..00000000 --- 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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BulkProperties/ConversionRateConfig.cs index dc62d8f9..e01415fb 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/BulkProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BulkProperties/ModelType.cs deleted file mode 100644 index e857d5b0..00000000 --- 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 a07d1038..8984eead 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +513,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ConversionRateConfig.cs index 4ba39b10..568556c9 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/BulkWithProrationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/BulkWithProrationProperties/ModelType.cs deleted file mode 100644 index 97b927e9..00000000 --- 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 c5d42fd6..e5396633 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ConversionRateConfig.cs index be3479ee..5e24cf64 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/CumulativeGroupedBulkProperties/ModelType.cs b/src/Orb/Models/PriceProperties/CumulativeGroupedBulkProperties/ModelType.cs deleted file mode 100644 index ea123de5..00000000 --- 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 7bf48028..5eb9e48c 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +513,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ConversionRateConfig.cs index 739e21b9..6d0536a7 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/GroupedAllocationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedAllocationProperties/ModelType.cs deleted file mode 100644 index 0c314bef..00000000 --- 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 f197c098..b8c3547d 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -512,7 +510,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 08174839..758a28b5 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ConversionRateConfig.cs index 424c0ae9..7939e72d 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/GroupedTieredPackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedTieredPackageProperties/ModelType.cs deleted file mode 100644 index aa00e775..00000000 --- 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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedTieredProperties/ConversionRateConfig.cs index a86b27c4..3c0be141 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/GroupedTieredProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedTieredProperties/ModelType.cs deleted file mode 100644 index eccf9fb9..00000000 --- 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 e299d68c..c41e682a 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ConversionRateConfig.cs index 8841c792..c61dec6d 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/GroupedWithMeteredMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedWithMeteredMinimumProperties/ModelType.cs deleted file mode 100644 index 2c5e63ea..00000000 --- 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 new file mode 100644 index 00000000..ce3384b9 --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholds.cs @@ -0,0 +1,543 @@ +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 Json::JsonElement 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); + } + 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.Name; + _ = this.PlanPhaseOrder; + this.PriceType.Validate(); + _ = this.ReplacesPriceID; + this.DimensionalPriceConfiguration?.Validate(); + } + + public GroupedWithMinMaxThresholds() + { + this.ModelType = Json::JsonSerializer.Deserialize( + "\"grouped_with_min_max_thresholds\"" + ); + } + +#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 00000000..57932222 --- /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 00000000..4024b7fa --- /dev/null +++ b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/ConversionRateConfig.cs @@ -0,0 +1,21 @@ +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 implicit operator ConversionRateConfig(Models::UnitConversionRateConfig value) => + new ConversionRateConfigVariants::UnitConversionRateConfig(value); + + public static implicit operator ConversionRateConfig( + Models::TieredConversionRateConfig value + ) => new ConversionRateConfigVariants::TieredConversionRateConfig(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 00000000..efa33a8a --- /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/PriceType.cs b/src/Orb/Models/PriceProperties/GroupedWithMinMaxThresholdsProperties/PriceType.cs new file mode 100644 index 00000000..14b6142e --- /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/PriceProperties/GroupedWithProratedMinimum.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimum.cs index 41f698c5..282776db 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -520,7 +517,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ConversionRateConfig.cs index 57c0fdd7..d44969a5 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/GroupedWithProratedMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/GroupedWithProratedMinimumProperties/ModelType.cs deleted file mode 100644 index 131cfeae..00000000 --- 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 55bb6f4e..cc440c55 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -501,7 +499,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MatrixProperties/ConversionRateConfig.cs index a407b509..f6025de0 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/MatrixProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MatrixProperties/ModelType.cs deleted file mode 100644 index e4630d3a..00000000 --- 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 c0d2c3e6..7a4cad68 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +512,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ConversionRateConfig.cs index 047b18b7..48a3c74e 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/MatrixWithAllocationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MatrixWithAllocationProperties/ModelType.cs deleted file mode 100644 index 4b98b467..00000000 --- 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 2d7a262c..8e7f8c7a 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ConversionRateConfig.cs index e4cfe1c6..d665d4c5 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/MatrixWithDisplayNameProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MatrixWithDisplayNameProperties/ModelType.cs deleted file mode 100644 index cd32ab4d..00000000 --- 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 fb251eec..407c09e8 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ConversionRateConfig.cs index 47c5fc1b..c0e953cd 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/MaxGroupTieredPackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/MaxGroupTieredPackageProperties/ModelType.cs deleted file mode 100644 index 091424d8..00000000 --- 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 76acf22d..a07153a5 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; this.PackageConfig.Validate(); _ = this.PlanPhaseOrder; @@ -501,7 +499,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/PackageProperties/ConversionRateConfig.cs index 4243edfa..7349322c 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/PackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/PackageProperties/ModelType.cs deleted file mode 100644 index 18685d7e..00000000 --- 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 e3f6832c..b581dfbe 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; foreach (var item in this.PackageWithAllocationConfig.Values) { @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ConversionRateConfig.cs index 97d80934..0ba60a0e 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/PackageWithAllocationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/PackageWithAllocationProperties/ModelType.cs deleted file mode 100644 index 8f352d0b..00000000 --- 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 abeea9ae..b2af1daf 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -525,7 +522,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ConversionRateConfig.cs index 1fe2fef8..07bbfd06 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/ScalableMatrixWithTieredPricingProperties/ModelType.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithTieredPricingProperties/ModelType.cs deleted file mode 100644 index 31c19527..00000000 --- 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 97b346bd..de4009cb 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -525,7 +522,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ConversionRateConfig.cs index 7ccdd530..41e7bf5c 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/ScalableMatrixWithUnitPricingProperties/ModelType.cs b/src/Orb/Models/PriceProperties/ScalableMatrixWithUnitPricingProperties/ModelType.cs deleted file mode 100644 index 8ca4bf84..00000000 --- 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 d2528c34..9ec3b9fc 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ConversionRateConfig.cs index 4cf3e6d5..44d59c72 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/ThresholdTotalAmountProperties/ModelType.cs b/src/Orb/Models/PriceProperties/ThresholdTotalAmountProperties/ModelType.cs deleted file mode 100644 index 4ccf6ef8..00000000 --- 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 61acae33..ad9317e5 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -501,7 +499,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 cd46ebe0..e1dcca00 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -504,7 +502,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredBPSProperties/ConversionRateConfig.cs index 3cd3d281..0cf469a3 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/TieredBPSProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredBPSProperties/ModelType.cs deleted file mode 100644 index ea58220b..00000000 --- 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 d3f86789..fe345cb2 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -512,7 +510,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredPackageProperties/ConversionRateConfig.cs index 85ecd4a2..73b0aa34 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/TieredPackageProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredPackageProperties/ModelType.cs deleted file mode 100644 index f211e86e..00000000 --- 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 594fa016..c9d520ed 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -519,7 +516,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ConversionRateConfig.cs index 9e788737..235d6dac 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/TieredPackageWithMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredPackageWithMinimumProperties/ModelType.cs deleted file mode 100644 index e3e6e578..00000000 --- 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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredProperties/ConversionRateConfig.cs index ef1defbf..9ac14d19 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/TieredProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredProperties/ModelType.cs deleted file mode 100644 index 846cfadb..00000000 --- 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 ca69b4c9..805771b9 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +513,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ConversionRateConfig.cs index 6a9c157f..4c3c99e1 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/TieredWithMinimumProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredWithMinimumProperties/ModelType.cs deleted file mode 100644 index 7eebbe88..00000000 --- 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 9613ef4b..55df0b4d 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -516,7 +513,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ConversionRateConfig.cs index eb14b5e4..0839b83d 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/TieredWithProrationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/TieredWithProrationProperties/ModelType.cs deleted file mode 100644 index 1c7a1181..00000000 --- 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 01abd024..0df50237 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -499,7 +497,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/UnitProperties/ConversionRateConfig.cs index 8e155e6a..ebaea576 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/UnitProperties/ModelType.cs b/src/Orb/Models/PriceProperties/UnitProperties/ModelType.cs deleted file mode 100644 index 85d8eaab..00000000 --- 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 31848f63..322376f1 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +513,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ConversionRateConfig.cs index fd56fa26..4429dd24 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/UnitWithPercentProperties/ModelType.cs b/src/Orb/Models/PriceProperties/UnitWithPercentProperties/ModelType.cs deleted file mode 100644 index 2ab398bd..00000000 --- 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 97447fff..c933a0c9 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,6 @@ public override void Validate() } this.Minimum?.Validate(); _ = this.MinimumAmount; - this.ModelType.Validate(); _ = this.Name; _ = this.PlanPhaseOrder; this.PriceType.Validate(); @@ -515,7 +513,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/ConversionRateConfig.cs b/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ConversionRateConfig.cs index b1277b12..4329d203 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/PriceProperties/UnitWithProrationProperties/ModelType.cs b/src/Orb/Models/PriceProperties/UnitWithProrationProperties/ModelType.cs deleted file mode 100644 index 76793b1f..00000000 --- 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/PriceVariants/All.cs b/src/Orb/Models/PriceVariants/All.cs index 0e04b679..7bd311a0 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/Models/Prices/EvaluatePriceGroupProperties/GroupingValue.cs b/src/Orb/Models/Prices/EvaluatePriceGroupProperties/GroupingValue.cs index 2f44d603..b2a1d6d6 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 80eefa19..4f51a69c 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 eeee512e..b1632ad0 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 9d86d2c4..df566f95 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 73194203..a9cea59f 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 caafd2fd..721f498c 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 da956354..794ee06c 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 f6b5944b..bb51203c 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 74c32349..76ae9a6a 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 112e04d4..6c907be9 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 c1bf93bb..997f298d 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 8551d004..f96a3485 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 8a1a6708..c54e945e 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 c144fe61..ad90b488 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 55dca971..9662d3f7 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 1352094e..dbc9a315 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 5b143992..b1d47e2c 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 a7731b5d..a3638d05 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 94edac4e..1a2f4f12 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 963abd44..fd56671a 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 c3e2c265..ea895ff7 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 cfbba907..2ca968f1 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 534e12b3..0e833838 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 bff6b250..7ed1c15a 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 fb1cf4ac..4ecedf22 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 016cf917..00b3bffc 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 39d9c9d5..9672c8d9 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 2e4adcaf..53a5c9cc 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 739ecfca..b91d6ce2 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 c577c27a..0f9014a8 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 9a11e27c..0ab5f2dc 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 24fd5ef9..21ee41da 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 d1fc6acf..d882029a 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 ad97f7cb..8987e26e 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 d21a34a5..c0db29af 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 4fa9bdb7..0aae3be3 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 11ce3aec..30a1b3e4 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 b2bdd274..0cd483cb 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 7c401c1e..bfea610d 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 cee0595c..d296e538 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 011e56fb..38a76c92 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 6e3d705b..d05331d7 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,12 @@ public required double AmountDiscount public override void Validate() { _ = this.AmountDiscount; - this.DiscountType.Validate(); } - 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 4ac283b6..00000000 --- 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 dd773e58..6f72a0ad 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,13 @@ public required double PercentageDiscount public override void Validate() { - this.DiscountType.Validate(); _ = 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 c6777abd..00000000 --- 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 7ebf5aa6..ad967b1a 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,13 @@ public required double UsageDiscount public override void Validate() { - this.DiscountType.Validate(); _ = 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 1f37c4b1..00000000 --- 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); - } -} diff --git a/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/EndDate.cs b/src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParamsProperties/AddProperties/EndDate.cs index b69f5afa..5e382770 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 50ff632c..0e969481 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 17a8cab1..f0f24ab5 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 20f5d933..73c5e16e 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 b1e7bfad..1a08506d 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 1881c253..db9dc1a1 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 9e83938d..91f9e669 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 91af98b2..dd2ec73c 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 348ab66f..b88d5205 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 5bfae501..02dc7cce 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 1f41f589..35acd255 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 2b025006..7e5f5a31 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 f2a3d26a..de38ed66 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 737f0876..c82d1692 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(); } diff --git a/src/Orb/Service/DimensionalPriceGroups/DimensionalPriceGroupService.cs b/src/Orb/Service/DimensionalPriceGroups/DimensionalPriceGroupService.cs index 96ef3a07..2ed92ac6 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 1698f482..fc02d86d 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 c7f3740a..64bbcdef 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 743e6bf5..7a26b90d 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 /// diff --git a/src/Orb/Service/Invoices/IInvoiceService.cs b/src/Orb/Service/Invoices/IInvoiceService.cs index fb7b8fad..47ceeb20 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);