From 25131170390f1c8cc7b7d010efdc033d1b2b292e Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 1 Jun 2023 19:05:13 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 1.0, Speakeay CLI 1.40.3 --- RELEASES.md | 10 +- docs/credit/README.md | 8 +- docs/event/README.md | 17 +- docs/invoice/README.md | 16 +- docs/plan/README.md | 318 ++++++++---------- docs/subscription/README.md | 233 +++++++------ files.gen | 4 +- gen.yaml | 4 +- setup.py | 2 +- src/orb/credit.py | 6 +- src/orb/event.py | 2 +- src/orb/models/operations/__init__.py | 2 +- .../fetch_customer_credits_ledger.py | 5 +- ...tch_customer_credits_ledger_external_id.py | 5 +- src/orb/models/operations/ingest.py | 9 +- src/orb/models/shared/__init__.py | 4 +- src/orb/models/shared/bpspriceoverride.py | 4 +- src/orb/models/shared/bulkbpspriceoverride.py | 4 +- src/orb/models/shared/bulkpriceoverride.py | 4 +- src/orb/models/shared/creditnote.py | 4 +- src/orb/models/shared/debug.py | 4 +- src/orb/models/shared/entrytype.py | 1 - .../models/shared/fixedfeequantitychange.py | 4 +- src/orb/models/shared/newcreditledgerentry.py | 9 +- src/orb/models/shared/newsubscription.py | 4 +- src/orb/models/shared/packagepriceoverride.py | 4 +- src/orb/models/shared/price.py | 4 +- .../models/shared/subscriptioncancellation.py | 4 +- .../models/shared/subscriptionplanchange.py | 4 +- src/orb/models/shared/subscriptionusage.py | 28 +- .../models/shared/tieredbpspriceoverride.py | 4 +- src/orb/models/shared/tieredpriceoverride.py | 4 +- src/orb/models/shared/unitpriceoverride.py | 4 +- src/orb/models/shared/usage.py | 21 ++ src/orb/models/shared/usageitem.py | 19 ++ src/orb/sdk.py | 2 +- 36 files changed, 409 insertions(+), 372 deletions(-) create mode 100755 src/orb/models/shared/usage.py create mode 100755 src/orb/models/shared/usageitem.py diff --git a/RELEASES.md b/RELEASES.md index aff50bd..e41d802 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -242,4 +242,12 @@ Based on: - OpenAPI Doc 1.0 ./openapi/openapi.yaml - Speakeasy CLI 1.40.3 (2.34.7) https://github.com/speakeasy-api/speakeasy ### Releases -- [PyPI v0.12.4] https://pypi.org/project/orb-billing/0.12.4 - . \ No newline at end of file +- [PyPI v0.12.4] https://pypi.org/project/orb-billing/0.12.4 - . + +## 2023-06-01 19:04:56 +### Changes +Based on: +- OpenAPI Doc 1.0 ./openapi/openapi.yaml +- Speakeasy CLI 1.40.3 (2.34.7) https://github.com/speakeasy-api/speakeasy +### Releases +- [PyPI v0.12.5] https://pypi.org/project/orb-billing/0.12.5 - . \ No newline at end of file diff --git a/docs/credit/README.md b/docs/credit/README.md index 6724f4a..4240f5d 100755 --- a/docs/credit/README.md +++ b/docs/credit/README.md @@ -35,7 +35,7 @@ res = s.credit.add_by_external_id('porro', shared.NewCreditLedgerEntry( amount=6788.8, block_id='dicta', description='nam', - entry_type=shared.EntryType1.DECREMENT, + entry_type=shared.EntryType.EXPIRATION_CHANGE, expiry_date=dateutil.parser.parse('2023-01-01').date(), invoice_settings=shared.NewCreditLedgerEntryInvoiceSettings( auto_collection=False, @@ -133,7 +133,7 @@ res = s.credit.create('qui', shared.NewCreditLedgerEntry( amount=7742.34, block_id='cum', description='esse', - entry_type=shared.EntryType1.INCREMENT, + entry_type=shared.EntryType.INCREMENT, expiry_date=dateutil.parser.parse('2023-01-01').date(), invoice_settings=shared.NewCreditLedgerEntryInvoiceSettings( auto_collection=False, @@ -248,7 +248,7 @@ s = orb.Orb( ) -res = s.credit.fetch_ledger('natus', shared.EntryStatus.COMMITTED, shared.EntryType.CREDIT_BLOCK_EXPIRY, 9025.99) +res = s.credit.fetch_ledger('natus', shared.EntryStatus.COMMITTED, 'hic', 9025.99) if res.credit_ledger_entries is not None: # handle response @@ -271,7 +271,7 @@ s = orb.Orb( ) -res = s.credit.fetch_ledger_by_external_id('fuga', shared.EntryStatus.COMMITTED, shared.EntryType.DECREMENT, 6130.64) +res = s.credit.fetch_ledger_by_external_id('fuga', shared.EntryStatus.COMMITTED, 'corporis', 6130.64) if res.credit_ledger_entries is not None: # handle response diff --git a/docs/event/README.md b/docs/event/README.md index 6b132d8..4bf8eae 100755 --- a/docs/event/README.md +++ b/docs/event/README.md @@ -334,7 +334,15 @@ res = s.event.ingest([ }, timestamp='2020-12-09T16:09:53Z', ), -], 'backfill_123', operations.IngestDebug.TRUE) +], 'backfill_123', shared.Debug( + duplicate=[ + 'totam', + 'dignissimos', + ], + ingested=[ + 'quis', + ], +)) if res.ingestion_response is not None: # handle response @@ -384,7 +392,7 @@ s = orb.Orb( ) -res = s.event.revert_backfill('totam') +res = s.event.revert_backfill('nesciunt') if res.backfill is not None: # handle response @@ -418,10 +426,9 @@ s = orb.Orb( req = shared.EventSearchCriteria( event_ids=[ - 'eaque', - 'quis', + 'perferendis', ], - invoice_id='nesciunt', + invoice_id='dolores', ) res = s.event.search(req) diff --git a/docs/invoice/README.md b/docs/invoice/README.md index 1329b0c..38c55bc 100755 --- a/docs/invoice/README.md +++ b/docs/invoice/README.md @@ -30,12 +30,12 @@ s = orb.Orb( ) req = shared.NewInvoiceLineItem( - amount='eos', - end_date=dateutil.parser.parse('2022-10-30').date(), + amount='minus', + end_date=dateutil.parser.parse('2022-10-11').date(), invoice_id='4khy3nwzktxv7', - name='Darryl Fadel', + name='Dean Welch', quantity=47hhsws4z2i13, - start_date=dateutil.parser.parse('2020-03-20').date(), + start_date=dateutil.parser.parse('2021-10-22').date(), ) res = s.invoice.create(req) @@ -61,7 +61,7 @@ s = orb.Orb( ) -res = s.invoice.fetch('omnis') +res = s.invoice.fetch('voluptatem') if res.invoice is not None: # handle response @@ -84,7 +84,7 @@ s = orb.Orb( ) -res = s.invoice.fetch_upcoming('facilis') +res = s.invoice.fetch_upcoming('porro') if res.upcoming_invoice is not None: # handle response @@ -111,7 +111,7 @@ s = orb.Orb( ) -res = s.invoice.list('perspiciatis', 'voluptatem', 'porro', 'consequuntur') +res = s.invoice.list('consequuntur', 'blanditiis', 'error', 'eaque') if res.invoices is not None: # handle response @@ -136,7 +136,7 @@ s = orb.Orb( ) -res = s.invoice.void('blanditiis') +res = s.invoice.void('occaecati') if res.invoice is not None: # handle response diff --git a/docs/plan/README.md b/docs/plan/README.md index a9555f9..d42856c 100755 --- a/docs/plan/README.md +++ b/docs/plan/README.md @@ -33,7 +33,7 @@ s = orb.Orb( ) -res = s.plan.fetch('error') +res = s.plan.fetch('rerum') if res.plan is not None: # handle response @@ -60,270 +60,246 @@ s = orb.Orb( ) -res = s.plan.get_by_external_id('eaque', shared.Plan( +res = s.plan.get_by_external_id('adipisci', shared.Plan( base_plan=shared.PlanBasePlan( - external_plan_id='occaecati', - id='b3fe49a8-d9cb-4f48-a333-23f9b77f3a41', - name='Angela Kerluke', + external_plan_id='asperiores', + id='e49a8d9c-bf48-4633-b23f-9b77f3a41006', + name='Bertha Thompson', ), - base_plan_id='accusamus', - created_at=dateutil.parser.isoparse('2021-01-18T05:23:42.271Z'), - currency='voluptas', - default_invoice_memo='natus', - description='eos', + base_plan_id='voluptas', + created_at=dateutil.parser.isoparse('2022-08-22T21:20:36.034Z'), + currency='atque', + default_invoice_memo='sit', + description='fugiat', discount=shared.Discount( - amount_discount='atque', + amount_discount='ab', applies_to_price_ids=[ - 'fugiat', + 'dolorum', + 'iusto', + 'voluptate', ], discount_type=shared.DiscountType.PERCENTAGE, percentage_discount=0.15, - trial_amount_discount='ab', - usage_discount=7438.35, + trial_amount_discount='dolorum', + usage_discount=5365.79, ), - external_plan_id='dolorum', - id='77a89ebf-737a-4e42-83ce-5e6a95d8a0d4', - invoicing_currency='tempora', + external_plan_id='omnis', + id='ebf737ae-4203-4ce5-a6a9-5d8a0d446ce2', + invoicing_currency='dolorum', minimum=shared.MinimumAmount( applies_to_price_ids=[ - 'quod', - 'officiis', + 'esse', + 'harum', + 'iusto', + 'ipsum', ], - minimum_amount='qui', + minimum_amount='quisquam', ), - name='Randal Klocko', - net_terms=215507, + name='Marvin Renner', + net_terms=313692, plan_phases=[ shared.PlanPhase( - description='tenetur', + description='sapiente', discount=shared.Discount( - amount_discount='amet', - applies_to_price_ids=[ - 'accusamus', - 'numquam', - 'enim', - ], - discount_type=shared.DiscountType.PERCENTAGE, - percentage_discount=0.15, - trial_amount_discount='dolorem', - usage_discount=9574.51, - ), - duration=518201, - duration_unit=shared.DurationUnit.QUARTERLY, - minimum=shared.MinimumAmount( + amount_discount='totam', applies_to_price_ids=[ + 'sit', 'expedita', ], - minimum_amount='neque', - ), - name='Gina Renner', - order=463575, - ), - shared.PlanPhase( - description='ipsum', - discount=shared.Discount( - amount_discount='incidunt', - applies_to_price_ids=[ - 'cupiditate', - ], - discount_type=shared.DiscountType.PERCENTAGE, - percentage_discount=0.15, - trial_amount_discount='maxime', - usage_discount=8638.56, - ), - duration=747080, - duration_unit=shared.DurationUnit.MONTHLY, - minimum=shared.MinimumAmount( - applies_to_price_ids=[ - 'totam', - 'incidunt', - 'aspernatur', - ], - minimum_amount='dolores', - ), - name='Cesar Hyatt', - order=840429, - ), - shared.PlanPhase( - description='qui', - discount=shared.Discount( - amount_discount='neque', - applies_to_price_ids=[ - 'magni', - ], discount_type=shared.DiscountType.PERCENTAGE, percentage_discount=0.15, - trial_amount_discount='odio', - usage_discount=1248.33, + trial_amount_discount='neque', + usage_discount=1536.94, ), - duration=355613, + duration=424685, duration_unit=shared.DurationUnit.ANNUAL, minimum=shared.MinimumAmount( applies_to_price_ids=[ - 'voluptatem', - 'cumque', - 'soluta', - 'nobis', - ], - minimum_amount='et', - ), - name='Dale Boehm', - order=731694, - ), - shared.PlanPhase( - description='cupiditate', - discount=shared.Discount( - amount_discount='aperiam', - applies_to_price_ids=[ - 'dolorem', - 'dolore', - 'labore', - 'adipisci', - ], - discount_type=shared.DiscountType.PERCENTAGE, - percentage_discount=0.15, - trial_amount_discount='dolorum', - usage_discount=1002.94, - ), - duration=63038, - duration_unit=shared.DurationUnit.MONTHLY, - minimum=shared.MinimumAmount( - applies_to_price_ids=[ - 'itaque', - 'consequatur', - 'est', + 'deserunt', + 'quam', ], - minimum_amount='repellendus', + minimum_amount='ipsum', ), - name='Domingo Grady', - order=181631, + name='Norma McGlynn', + order=747080, ), ], prices=[ shared.Price( billable_metric=shared.PriceBillableMetric( - id='879fce95-3f73-4ef7-bbc7-abd74dd39c0f', + id='a8422bb6-79d2-4322-b15b-f0cbb1e31b8b', ), bps_config=shared.PriceBpsConfig( - bps=3472.33, - per_unit_maximum='nulla', + bps=5844.76, + per_unit_maximum='aperiam', ), bulk_bps_config=shared.PriceBulkBpsConfig( tiers=[ shared.PriceBulkBpsConfigTiers( - bps=7804.27, - maximum_amount='maiores', - per_unit_maximum='doloribus', + bps=2091.57, + maximum_amount='dolore', + per_unit_maximum='labore', + ), + shared.PriceBulkBpsConfigTiers( + bps=2408.29, + maximum_amount='dolorum', + per_unit_maximum='architecto', + ), + shared.PriceBulkBpsConfigTiers( + bps=630.38, + maximum_amount='aut', + per_unit_maximum='quas', + ), + shared.PriceBulkBpsConfigTiers( + bps=9295.3, + maximum_amount='consequatur', + per_unit_maximum='est', ), ], ), bulk_config=shared.PriceBulkConfig( tiers=[ shared.PriceBulkConfigTiers( - maximum_units='eligendi', - unit_amount='ducimus', + maximum_units='porro', + unit_amount='doloribus', + ), + shared.PriceBulkConfigTiers( + maximum_units='ut', + unit_amount='facilis', ), shared.PriceBulkConfigTiers( - maximum_units='alias', - unit_amount='officia', + maximum_units='cupiditate', + unit_amount='qui', + ), + shared.PriceBulkConfigTiers( + maximum_units='quae', + unit_amount='laudantium', ), ], ), - cadence=shared.PriceCadence.ANNUAL, - created_at=dateutil.parser.isoparse('2022-08-04T04:05:19.236Z'), + cadence=shared.Cadence.MONTHLY, + created_at=dateutil.parser.isoparse('2021-01-17T10:17:06.805Z'), currency='USD', discount=shared.Discount( - amount_discount='aspernatur', + amount_discount='quisquam', applies_to_price_ids=[ - 'possimus', - 'magnam', + 'omnis', + 'quis', + 'ipsum', + 'delectus', ], discount_type=shared.DiscountType.PERCENTAGE, percentage_discount=0.15, - trial_amount_discount='ratione', - usage_discount=4011.32, + trial_amount_discount='voluptate', + usage_discount=2317.01, ), - fixed_price_quantity=5113.19, - id='13f16d9f-5fce-46c5-9614-6c3e250fb008', + fixed_price_quantity=8788.7, + id='f7fbc7ab-d74d-4d39-80f5-d2cff7c70a45', matrix_config=shared.PriceMatrixConfig( - default_unit_amount='impedit', + default_unit_amount='ea', dimensions=[ - 'fugit', - 'accusamus', + 'vel', ], matrix_values=[ shared.PriceMatrixConfigMatrixValues( dimension_values=[ - 'et', - 'dolorum', + 'ratione', + 'ex', + ], + unit_amount='laudantium', + ), + shared.PriceMatrixConfigMatrixValues( + dimension_values=[ + 'dolor', + ], + unit_amount='maiores', + ), + shared.PriceMatrixConfigMatrixValues( + dimension_values=[ + 'ex', + ], + unit_amount='nulla', + ), + shared.PriceMatrixConfigMatrixValues( + dimension_values=[ + 'voluptatibus', + 'nostrum', + 'sapiente', ], - unit_amount='laborum', + unit_amount='quisquam', ), ], ), minimum=shared.MinimumAmount( applies_to_price_ids=[ - 'velit', - 'eum', - 'autem', - 'nobis', + 'ea', + 'impedit', + 'corporis', + 'veniam', ], - minimum_amount='quas', + minimum_amount='aliquid', ), - model_type=shared.PriceModelType.BULK_BPS, - name='Mrs. Shane Reinger', + model_type=shared.PriceModelType.UNIT, + name='Rosemary Ryan', package_config=shared.PricePackageConfig( - package_amount='explicabo', - package_size=5919.35, + package_amount='aspernatur', + package_size=3253.1, ), - plan_phase_order=553.74, + plan_phase_order=534.27, tiered_bps_config=shared.PriceTieredBpsConfig( tiers=[ shared.PriceTieredBpsConfigTiers( - bps=3015.98, - maximum_amount='odio', - minimum_amount='eius', - per_unit_maximum='esse', + bps=7255.95, + maximum_amount='aut', + minimum_amount='aut', + per_unit_maximum='deleniti', + ), + shared.PriceTieredBpsConfigTiers( + bps=7705.81, + maximum_amount='aliquam', + minimum_amount='fugit', + per_unit_maximum='accusamus', ), shared.PriceTieredBpsConfigTiers( - bps=4561.41, - maximum_amount='rem', - minimum_amount='fuga', - per_unit_maximum='reprehenderit', + bps=795.22, + maximum_amount='non', + minimum_amount='et', + per_unit_maximum='dolorum', + ), + shared.PriceTieredBpsConfigTiers( + bps=6720.48, + maximum_amount='placeat', + minimum_amount='velit', + per_unit_maximum='eum', ), ], ), tiered_config=shared.PriceTieredConfig( tiers=[ shared.PriceTieredConfigTiers( - first_unit='fugiat', - last_unit='ut', - unit_amount='eum', - ), - shared.PriceTieredConfigTiers( - first_unit='suscipit', - last_unit='assumenda', - unit_amount='eos', + first_unit='nobis', + last_unit='quas', + unit_amount='assumenda', ), shared.PriceTieredConfigTiers( - first_unit='praesentium', - last_unit='quisquam', - unit_amount='veritatis', + first_unit='nulla', + last_unit='voluptas', + unit_amount='libero', ), ], ), unit_config=shared.PriceUnitConfig( - unit_amount='ipsa', + unit_amount='quasi', ), ), ], product=shared.PlanProduct( - created_at=dateutil.parser.isoparse('2021-08-10T04:36:29.661Z'), - id='3cdca425-1904-4e52-bc7e-0bc7178e4796', - name='Todd Oberbrunner DDS', + created_at=dateutil.parser.isoparse('2022-09-29T12:13:01.368Z'), + id='29074747-78a7-4bd4-a6d2-8c10ab3cdca4', + name='Brittany Bernier II', ), trial_config=shared.PlanTrialConfig( - trial_period=4304.02, + trial_period=8920.5, trial_period_unit=shared.PlanTrialConfigTrialPeriodUnit.DAYS, ), )) diff --git a/docs/subscription/README.md b/docs/subscription/README.md index 2297023..c108df5 100755 --- a/docs/subscription/README.md +++ b/docs/subscription/README.md @@ -56,8 +56,8 @@ s = orb.Orb( ) -res = s.subscription.cancel('quas', shared.SubscriptionCancellation( - cancel_option=shared.SubscriptionCancellationCancelOption.IMMEDIATE, +res = s.subscription.cancel('ipsam', shared.SubscriptionCancellation( + cancel_option=shared.CancelOptions.IMMEDIATE, cancellation_date=dateutil.parser.isoparse('2017-07-21T17:32:28Z'), )) @@ -427,102 +427,116 @@ s = orb.Orb( req = shared.NewSubscription( align_billing_with_subscription_start_date=False, auto_collection=False, - coupon_redemption_code='praesentium', + coupon_redemption_code='aspernatur', customer_id='97DPcZE9hxsbb9Y9', - default_invoice_memo='consequuntur', - external_customer_id='deleniti', - external_marketplace=shared.NewSubscriptionExternalMarketplace.GOOGLE, + default_invoice_memo='sequi', + external_customer_id='quo', + external_marketplace=shared.ExternalMarketplace.GOOGLE, external_marketplace_reporting_id='project_number:983410661111', - external_plan_id='fugit', + external_plan_id='esse', metadata={ - "mollitia": 'incidunt', - "atque": 'explicabo', - "minima": 'nisi', + "aperiam": 'distinctio', + "quod": 'dignissimos', + "inventore": 'nihil', + "totam": 'accusamus', }, minimum_amount='1.23', - net_terms=147014, + net_terms=306810, phase_overrides=[ shared.PhaseOverride( discount=shared.Discount( - amount_discount='consequuntur', + amount_discount='occaecati', applies_to_price_ids=[ - 'explicabo', + 'sapiente', + 'dolores', ], discount_type=shared.DiscountType.PERCENTAGE, percentage_discount=0.15, - trial_amount_discount='saepe', - usage_discount=5789.22, + trial_amount_discount='deserunt', + usage_discount=4752.89, ), - minimum_amount='atque', - order=922.6, + minimum_amount='accusantium', + order=7836.48, ), shared.PhaseOverride( discount=shared.Discount( - amount_discount='esse', + amount_discount='eum', applies_to_price_ids=[ - 'accusamus', - 'veritatis', - 'esse', - 'quod', + 'praesentium', + 'consequuntur', + 'deleniti', ], discount_type=shared.DiscountType.PERCENTAGE, percentage_discount=0.15, - trial_amount_discount='nam', - usage_discount=8771.31, + trial_amount_discount='fugit', + usage_discount=6813.93, ), - minimum_amount='aliquid', - order=934.59, + minimum_amount='mollitia', + order=2775.96, ), - shared.PhaseOverride( - discount=shared.Discount( - amount_discount='saepe', - applies_to_price_ids=[ - 'harum', - 'molestiae', + ], + plan_id='ZMwNQefe7J3ecf7W', + price_overrides=[ + shared.TieredPriceOverride( + id='mqBkze6HoCwL4ytV', + minimum_amount='1.23', + model_type=shared.TieredModelType.TIERED, + tiered_config=shared.TieredPriceOverrideTieredConfig( + tiers=[ + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), ], - discount_type=shared.DiscountType.PERCENTAGE, - percentage_discount=0.15, - trial_amount_discount='rerum', - usage_discount=5801.97, ), - minimum_amount='minima', - order=7162.44, ), - shared.PhaseOverride( - discount=shared.Discount( - amount_discount='eligendi', - applies_to_price_ids=[ - 'culpa', + shared.BulkPriceOverride( + bulk_config=shared.BulkPriceOverrideBulkConfig( + tiers=[ + shared.BulkPriceOverrideBulkConfigTiers( + maximum_units='sapiente', + unit_amount='consequuntur', + ), ], - discount_type=shared.DiscountType.PERCENTAGE, - percentage_discount=0.15, - trial_amount_discount='tempore', - usage_discount=2400.2, ), - minimum_amount='cumque', - order=1605.38, + id='22e9817e-e17c-4be6-9e6b-7b95bc0ab3c2', + minimum_amount='1.23', + model_type=shared.BulkModelType.BULK, ), - ], - plan_id='ZMwNQefe7J3ecf7W', - price_overrides=[ - shared.BulkBPSPriceOverride( - bulk_bps_config=shared.BulkBPSPriceOverrideBulkBPSConfig( + shared.TieredPriceOverride( + id='mqBkze6HoCwL4ytV', + minimum_amount='1.23', + model_type=shared.TieredModelType.TIERED, + tiered_config=shared.TieredPriceOverrideTieredConfig( tiers=[ - shared.BulkBPSPriceOverrideBulkBPSConfigTiers( - bps=9591.67, - maximum_amount='consectetur', - per_unit_maximum='esse', + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', ), - shared.BulkBPSPriceOverrideBulkBPSConfigTiers( - bps=5034.27, - maximum_amount='provident', - per_unit_maximum='a', + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', ), ], ), - id='d871f99d-d2ef-4d12-9aa6-f1e674bdb04f', - minimum_amount='1.23', - model_type=shared.BulkBPSPriceOverrideModelType.BULK_BPS, ), ], start_date=dateutil.parser.parse('2022-01-01').date(), @@ -551,7 +565,7 @@ s = orb.Orb( ) -res = s.subscription.fetch('dicta') +res = s.subscription.fetch('quaerat') if res.subscription is not None: # handle response @@ -578,8 +592,8 @@ s = orb.Orb( ) req = operations.FetchSubscriptionCostsRequest( - group_by='ullam', - subscription_id='reprehenderit', + group_by='sapiente', + subscription_id='consectetur', timeframe_end='2022-03-01T05:00:00Z', timeframe_start=dateutil.parser.isoparse('2022-02-01T05:00:00Z'), view_mode=shared.ViewMode.PERIODIC, @@ -608,7 +622,7 @@ s = orb.Orb( ) -res = s.subscription.fetch_schedule('nisi') +res = s.subscription.fetch_schedule('blanditiis') if res.subscription_schedule is not None: # handle response @@ -753,10 +767,10 @@ s = orb.Orb( ) req = operations.FetchSubscriptionUsageRequest( - billable_metric_id='aut', + billable_metric_id='provident', granularity=operations.FetchSubscriptionUsageGranularity.DAY, - group_by='voluptatum', - subscription_id='qui', + group_by='a', + subscription_id='nulla', timeframe_end='2022-03-01T05:00:00Z', timeframe_start=dateutil.parser.isoparse('2022-02-01T05:00:00Z'), view_mode=shared.ViewMode.CUMULATIVE, @@ -787,7 +801,7 @@ s = orb.Orb( ) -res = s.subscription.list('ex', 'deleniti') +res = s.subscription.list('esse', 'quasi') if res.subscriptions is not None: # handle response @@ -829,19 +843,57 @@ s = orb.Orb( ) -res = s.subscription.schedule_plan_change('itaque', shared.SubscriptionPlanChange( +res = s.subscription.schedule_plan_change('a', shared.SubscriptionPlanChange( align_billing_with_plan_change_date=False, change_date=dateutil.parser.isoparse('2017-07-21T17:32:28Z'), - change_option=shared.SubscriptionPlanChangeChangeOption.IMMEDIATE, - coupon_redemption_code='architecto', + change_option=shared.ChangeOptions.END_OF_SUBSCRIPTION_TERM, + coupon_redemption_code='sint', external_plan_id='ZMwNQefe7J3ecf7W', minimum_amount='1.23', plan_id='ZMwNQefe7J3ecf7W', price_overrides=[ + shared.BulkBPSPriceOverride( + bulk_bps_config=shared.BulkBPSPriceOverrideBulkBPSConfig( + tiers=[ + shared.BulkBPSPriceOverrideBulkBPSConfigTiers( + bps=9088.44, + maximum_amount='asperiores', + per_unit_maximum='facere', + ), + ], + ), + id='121aa6f1-e674-4bdb-84f1-5756082d68ea', + minimum_amount='1.23', + model_type=shared.BulkBpsModelType.BULK_BPS, + ), + shared.TieredPriceOverride( + id='mqBkze6HoCwL4ytV', + minimum_amount='1.23', + model_type=shared.TieredModelType.TIERED, + tiered_config=shared.TieredPriceOverrideTieredConfig( + tiers=[ + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), + shared.TieredPriceOverrideTieredConfigTiers( + first_unit='0', + last_unit='10', + unit_amount='2.5', + ), + ], + ), + ), shared.TieredBPSPriceOverride( id='1d170513-39d0-4808-aa18-40394c26071f', minimum_amount='1.23', - model_type=shared.TieredBPSPriceOverrideModelType.TIERED_BPS, + model_type=shared.TieredBpsModelType.TIERED_BPS, tiered_bps_config=shared.TieredBPSPriceOverrideTieredBPSConfig( tiers=[ shared.TieredBPSPriceOverrideTieredBPSConfigTiers( @@ -872,20 +924,7 @@ res = s.subscription.schedule_plan_change('itaque', shared.SubscriptionPlanChang ), id='15cc413a-a63a-4ae8-9678-64dbb675fd5e', minimum_amount='1.23', - model_type=shared.BPSPriceOverrideModelType.BPS, - ), - shared.BulkPriceOverride( - bulk_config=shared.BulkPriceOverrideBulkConfig( - tiers=[ - shared.BulkPriceOverrideBulkConfigTiers( - maximum_units='cum', - unit_amount='consectetur', - ), - ], - ), - id='75ed4f6f-bee4-41f3-b317-fe35b60eb1ea', - minimum_amount='1.23', - model_type=shared.BulkPriceOverrideModelType.BULK, + model_type=shared.BpsModelType.BPS, ), ], )) @@ -913,7 +952,7 @@ s = orb.Orb( ) -res = s.subscription.unschedule_cancellation('tempora') +res = s.subscription.unschedule_cancellation('aliquid') if res.subscription is not None: # handle response @@ -936,7 +975,7 @@ s = orb.Orb( ) -res = s.subscription.unschedule_plan_change('aspernatur') +res = s.subscription.unschedule_plan_change('aperiam') if res.subscription is not None: # handle response @@ -966,11 +1005,11 @@ s = orb.Orb( ) -res = s.subscription.update_fixed_fee_quantity('voluptas', shared.FixedFeeQuantityChange( - change_option=shared.FixedFeeQuantityChangeChangeOption.EFFECTIVE_DATE, +res = s.subscription.update_fixed_fee_quantity('cum', shared.FixedFeeQuantityChange( + change_option=shared.FeeChangeOption.EFFECTIVE_DATE, effective_date=dateutil.parser.parse('"2022-12-21"').date(), - price_id='voluptas', - quantity=3742.96, + price_id='consectetur', + quantity=4490.83, )) if res.subscription is not None: diff --git a/files.gen b/files.gen index d1a0386..4e082d7 100755 --- a/files.gen +++ b/files.gen @@ -87,10 +87,10 @@ src/orb/models/shared/paymentprovider.py src/orb/models/shared/billing_address.py src/orb/models/shared/creditledgerentry.py src/orb/models/shared/newcreditledgerentry.py +src/orb/models/shared/entrytype.py src/orb/models/shared/credits.py src/orb/models/shared/credit.py src/orb/models/shared/creditledgerentries.py -src/orb/models/shared/entrytype.py src/orb/models/shared/entrystatus.py src/orb/models/shared/creditnotes.py src/orb/models/shared/creditnote.py @@ -139,6 +139,8 @@ src/orb/models/shared/subscriptioncost.py src/orb/models/shared/subscriptionschedule.py src/orb/models/shared/subscriptionscheduleitem.py src/orb/models/shared/subscriptionusage.py +src/orb/models/shared/usage.py +src/orb/models/shared/usageitem.py src/orb/models/shared/subscriptionplanchange.py src/orb/models/shared/fixedfeequantitychange.py src/orb/models/shared/security.py diff --git a/gen.yaml b/gen.yaml index 2812aee..9d75af7 100644 --- a/gen.yaml +++ b/gen.yaml @@ -1,6 +1,6 @@ configVersion: 1.0.0 management: - docChecksum: 65e0bc6c15e391cf400279eec9fd7392 + docChecksum: 93f14d4d4b4c786f42165e8b90253a99 docVersion: "1.0" speakeasyVersion: 1.40.3 generationVersion: 2.34.7 @@ -9,7 +9,7 @@ generation: singleTagPerOp: false telemetryEnabled: false python: - version: 0.12.4 + version: 0.12.5 author: Orb-Speakeasy description: Python Client SDK Generated by Speakeasy maxMethodParams: 4 diff --git a/setup.py b/setup.py index b9d7395..733371a 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="orb-billing", - version="0.12.4", + version="0.12.5", author="Orb-Speakeasy", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/src/orb/credit.py b/src/orb/credit.py index 0bdaa60..ecdb7be 100755 --- a/src/orb/credit.py +++ b/src/orb/credit.py @@ -3,7 +3,7 @@ import requests as requests_http from . import utils from orb.models import operations, shared -from typing import Optional +from typing import Any, Optional class Credit: r"""The Credits resource represents a customer's credits. Credits are created when a customer's invoice is paid, and are updated when a customer's transaction is refunded.""" @@ -211,7 +211,7 @@ def fetch_by_external_id(self, external_customer_id: str) -> operations.FetchCus return res - def fetch_ledger(self, customer_id: str, entry_status: Optional[shared.EntryStatus] = None, entry_type: Optional[shared.EntryType] = None, minimum_amount: Optional[float] = None) -> operations.FetchCustomerCreditsLedgerResponse: + def fetch_ledger(self, customer_id: str, entry_status: Optional[shared.EntryStatus] = None, entry_type: Optional[Any] = None, minimum_amount: Optional[float] = None) -> operations.FetchCustomerCreditsLedgerResponse: r"""View credits ledger The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit balance. This [paginated endpoint](../api/pagination) lists these entries, starting from the most recent ledger entry. @@ -275,7 +275,7 @@ def fetch_ledger(self, customer_id: str, entry_status: Optional[shared.EntryStat return res - def fetch_ledger_by_external_id(self, external_customer_id: str, entry_status: Optional[shared.EntryStatus] = None, entry_type: Optional[shared.EntryType] = None, minimum_amount: Optional[float] = None) -> operations.FetchCustomerCreditsLedgerExternalIDResponse: + def fetch_ledger_by_external_id(self, external_customer_id: str, entry_status: Optional[shared.EntryStatus] = None, entry_type: Optional[Any] = None, minimum_amount: Optional[float] = None) -> operations.FetchCustomerCreditsLedgerExternalIDResponse: r"""View credits ledger by external customer ID This endpoint's resource and semantics exactly mirror [View credits ledger](fetch-customer-credits-ledger) but operates on an [external customer ID](../guides/events-and-metrics/customer-aliases) rather than an Orb issued identifier. """ diff --git a/src/orb/event.py b/src/orb/event.py index 62ae8b0..96e8491 100755 --- a/src/orb/event.py +++ b/src/orb/event.py @@ -193,7 +193,7 @@ def deprecate_event(self, event_id: str) -> operations.DeprecateEventResponse: return res - def ingest(self, request_body: Optional[list[shared.Event]] = None, backfill_id: Optional[str] = None, debug: Optional[operations.IngestDebug] = None) -> operations.IngestResponse: + def ingest(self, request_body: Optional[list[shared.Event]] = None, backfill_id: Optional[str] = None, debug: Optional[shared.Debug] = None) -> operations.IngestResponse: r"""Ingest events Orb's event ingestion model and API is designed around two core principles: diff --git a/src/orb/models/operations/__init__.py b/src/orb/models/operations/__init__.py index 511f657..3b8c099 100755 --- a/src/orb/models/operations/__init__.py +++ b/src/orb/models/operations/__init__.py @@ -54,4 +54,4 @@ from .update_customer_external_id import * from .update_fixed_fee_quantity import * -__all__ = ["AddLedgerEntryExternalIDRequest","AddLedgerEntryExternalIDResponse","AmendEvent400ApplicationJSON","AmendEvent400ApplicationJSONValidationErrors","AmendEventRequest","AmendEventResponse","AmendUsage400ApplicationJSON","AmendUsage400ApplicationJSONValidationErrors","AmendUsageExternalCustomerID400ApplicationJSON","AmendUsageExternalCustomerID400ApplicationJSONValidationErrors","AmendUsageExternalCustomerIDRequest","AmendUsageExternalCustomerIDResponse","AmendUsageRequest","AmendUsageResponse","ArchiveCouponRequest","ArchiveCouponResponse","CancelSubscriptionRequest","CancelSubscriptionResponse","CloseBackfillRequest","CloseBackfillResponse","CreateBackfillResponse","CreateCouponResponse","CreateCustomerResponse","CreateInvoiceLineItemResponse","CreateLedgerEntryRequest","CreateLedgerEntryResponse","CreateSubscriptionResponse","DeleteCustomerRequest","DeleteCustomerResponse","DeprecateEvent400ApplicationJSON","DeprecateEvent400ApplicationJSONValidationErrors","DeprecateEventRequest","DeprecateEventResponse","FetchCouponRequest","FetchCouponResponse","FetchCustomerCostsExternalIDRequest","FetchCustomerCostsExternalIDResponse","FetchCustomerCostsRequest","FetchCustomerCostsResponse","FetchCustomerCreditsExternalIDRequest","FetchCustomerCreditsExternalIDResponse","FetchCustomerCreditsLedgerExternalIDRequest","FetchCustomerCreditsLedgerExternalIDResponse","FetchCustomerCreditsLedgerRequest","FetchCustomerCreditsLedgerResponse","FetchCustomerCreditsRequest","FetchCustomerCreditsResponse","FetchCustomerExternalIDRequest","FetchCustomerExternalIDResponse","FetchCustomerRequest","FetchCustomerResponse","FetchInvoiceRequest","FetchInvoiceResponse","FetchPlanExternalIDRequest","FetchPlanExternalIDResponse","FetchPlanRequest","FetchPlanResponse","FetchSubscriptionCostsRequest","FetchSubscriptionCostsResponse","FetchSubscriptionRequest","FetchSubscriptionResponse","FetchSubscriptionScheduleRequest","FetchSubscriptionScheduleResponse","FetchSubscriptionUsageGranularity","FetchSubscriptionUsageRequest","FetchSubscriptionUsageResponse","FetchUpcomingInvoiceRequest","FetchUpcomingInvoiceResponse","Ingest400ApplicationJSON","Ingest400ApplicationJSONValidationErrors","IngestDebug","IngestRequest","IngestResponse","ListBackfillsResponse","ListBalanceTransactionsRequest","ListBalanceTransactionsResponse","ListCouponSubscriptionsRequest","ListCouponSubscriptionsResponse","ListCouponsRequest","ListCouponsResponse","ListCreditNoteRequest","ListCreditNoteResponse","ListCustomersResponse","ListInvoicesRequest","ListInvoicesResponse","ListPlansResponse","ListSubscriptionsRequest","ListSubscriptionsResponse","PingAvailability","PingResponse","PostCustomersCustomerIDBalanceTransactionsRequest","PostCustomersCustomerIDBalanceTransactionsResponse","PostInvoicesInvoiceIDVoid400ApplicationJSON","PostInvoicesInvoiceIDVoid400ApplicationJSONValidationErrors","PostInvoicesInvoiceIDVoidRequest","PostInvoicesInvoiceIDVoidResponse","RevertBackfillRequest","RevertBackfillResponse","SchedulePlanChangeRequest","SchedulePlanChangeResponse","SearchEventsResponse","UnscheduleCancellationRequest","UnscheduleCancellationResponse","UnschedulePlanChangeRequest","UnschedulePlanChangeResponse","UpdateCustomerExternalIDRequest","UpdateCustomerExternalIDResponse","UpdateCustomerRequest","UpdateCustomerResponse","UpdateFixedFeeQuantityRequest","UpdateFixedFeeQuantityResponse"] +__all__ = ["AddLedgerEntryExternalIDRequest","AddLedgerEntryExternalIDResponse","AmendEvent400ApplicationJSON","AmendEvent400ApplicationJSONValidationErrors","AmendEventRequest","AmendEventResponse","AmendUsage400ApplicationJSON","AmendUsage400ApplicationJSONValidationErrors","AmendUsageExternalCustomerID400ApplicationJSON","AmendUsageExternalCustomerID400ApplicationJSONValidationErrors","AmendUsageExternalCustomerIDRequest","AmendUsageExternalCustomerIDResponse","AmendUsageRequest","AmendUsageResponse","ArchiveCouponRequest","ArchiveCouponResponse","CancelSubscriptionRequest","CancelSubscriptionResponse","CloseBackfillRequest","CloseBackfillResponse","CreateBackfillResponse","CreateCouponResponse","CreateCustomerResponse","CreateInvoiceLineItemResponse","CreateLedgerEntryRequest","CreateLedgerEntryResponse","CreateSubscriptionResponse","DeleteCustomerRequest","DeleteCustomerResponse","DeprecateEvent400ApplicationJSON","DeprecateEvent400ApplicationJSONValidationErrors","DeprecateEventRequest","DeprecateEventResponse","FetchCouponRequest","FetchCouponResponse","FetchCustomerCostsExternalIDRequest","FetchCustomerCostsExternalIDResponse","FetchCustomerCostsRequest","FetchCustomerCostsResponse","FetchCustomerCreditsExternalIDRequest","FetchCustomerCreditsExternalIDResponse","FetchCustomerCreditsLedgerExternalIDRequest","FetchCustomerCreditsLedgerExternalIDResponse","FetchCustomerCreditsLedgerRequest","FetchCustomerCreditsLedgerResponse","FetchCustomerCreditsRequest","FetchCustomerCreditsResponse","FetchCustomerExternalIDRequest","FetchCustomerExternalIDResponse","FetchCustomerRequest","FetchCustomerResponse","FetchInvoiceRequest","FetchInvoiceResponse","FetchPlanExternalIDRequest","FetchPlanExternalIDResponse","FetchPlanRequest","FetchPlanResponse","FetchSubscriptionCostsRequest","FetchSubscriptionCostsResponse","FetchSubscriptionRequest","FetchSubscriptionResponse","FetchSubscriptionScheduleRequest","FetchSubscriptionScheduleResponse","FetchSubscriptionUsageGranularity","FetchSubscriptionUsageRequest","FetchSubscriptionUsageResponse","FetchUpcomingInvoiceRequest","FetchUpcomingInvoiceResponse","Ingest400ApplicationJSON","Ingest400ApplicationJSONValidationErrors","IngestRequest","IngestResponse","ListBackfillsResponse","ListBalanceTransactionsRequest","ListBalanceTransactionsResponse","ListCouponSubscriptionsRequest","ListCouponSubscriptionsResponse","ListCouponsRequest","ListCouponsResponse","ListCreditNoteRequest","ListCreditNoteResponse","ListCustomersResponse","ListInvoicesRequest","ListInvoicesResponse","ListPlansResponse","ListSubscriptionsRequest","ListSubscriptionsResponse","PingAvailability","PingResponse","PostCustomersCustomerIDBalanceTransactionsRequest","PostCustomersCustomerIDBalanceTransactionsResponse","PostInvoicesInvoiceIDVoid400ApplicationJSON","PostInvoicesInvoiceIDVoid400ApplicationJSONValidationErrors","PostInvoicesInvoiceIDVoidRequest","PostInvoicesInvoiceIDVoidResponse","RevertBackfillRequest","RevertBackfillResponse","SchedulePlanChangeRequest","SchedulePlanChangeResponse","SearchEventsResponse","UnscheduleCancellationRequest","UnscheduleCancellationResponse","UnschedulePlanChangeRequest","UnschedulePlanChangeResponse","UpdateCustomerExternalIDRequest","UpdateCustomerExternalIDResponse","UpdateCustomerRequest","UpdateCustomerResponse","UpdateFixedFeeQuantityRequest","UpdateFixedFeeQuantityResponse"] diff --git a/src/orb/models/operations/fetch_customer_credits_ledger.py b/src/orb/models/operations/fetch_customer_credits_ledger.py index 38d18b0..3ee5c98 100755 --- a/src/orb/models/operations/fetch_customer_credits_ledger.py +++ b/src/orb/models/operations/fetch_customer_credits_ledger.py @@ -5,8 +5,7 @@ import requests as requests_http from ..shared import creditledgerentries as shared_creditledgerentries from ..shared import entrystatus as shared_entrystatus -from ..shared import entrytype as shared_entrytype -from typing import Optional +from typing import Any, Optional @dataclasses.dataclass @@ -15,7 +14,7 @@ class FetchCustomerCreditsLedgerRequest: customer_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customer_id', 'style': 'simple', 'explode': False }}) entry_status: Optional[shared_entrystatus.EntryStatus] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'entry_status', 'style': 'form', 'explode': True }}) r"""Filters to a single status of ledger entry""" - entry_type: Optional[shared_entrytype.EntryType] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'entry_type', 'style': 'form', 'explode': True }}) + entry_type: Optional[Any] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'entry_type', 'style': 'form', 'explode': True }}) r"""Filter to a single type of ledger entry""" minimum_amount: Optional[float] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'minimum_amount', 'style': 'form', 'explode': True }}) r"""Filter to ledger entries that affect at least this amount""" diff --git a/src/orb/models/operations/fetch_customer_credits_ledger_external_id.py b/src/orb/models/operations/fetch_customer_credits_ledger_external_id.py index 680861e..d8e41ac 100755 --- a/src/orb/models/operations/fetch_customer_credits_ledger_external_id.py +++ b/src/orb/models/operations/fetch_customer_credits_ledger_external_id.py @@ -5,8 +5,7 @@ import requests as requests_http from ..shared import creditledgerentries as shared_creditledgerentries from ..shared import entrystatus as shared_entrystatus -from ..shared import entrytype as shared_entrytype -from typing import Optional +from typing import Any, Optional @dataclasses.dataclass @@ -15,7 +14,7 @@ class FetchCustomerCreditsLedgerExternalIDRequest: external_customer_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'external_customer_id', 'style': 'simple', 'explode': False }}) entry_status: Optional[shared_entrystatus.EntryStatus] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'entry_status', 'style': 'form', 'explode': True }}) r"""Filters to a single status of ledger entry""" - entry_type: Optional[shared_entrytype.EntryType] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'entry_type', 'style': 'form', 'explode': True }}) + entry_type: Optional[Any] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'entry_type', 'style': 'form', 'explode': True }}) r"""Filter to a single type of ledger entry""" minimum_amount: Optional[float] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'minimum_amount', 'style': 'form', 'explode': True }}) r"""Filter to ledger entries that affect at least this amount""" diff --git a/src/orb/models/operations/ingest.py b/src/orb/models/operations/ingest.py index 5232b3d..590b5d3 100755 --- a/src/orb/models/operations/ingest.py +++ b/src/orb/models/operations/ingest.py @@ -3,25 +3,20 @@ from __future__ import annotations import dataclasses import requests as requests_http +from ..shared import debug as shared_debug from ..shared import event as shared_event from ..shared import ingestionresponse as shared_ingestionresponse from dataclasses_json import Undefined, dataclass_json -from enum import Enum from orb import utils from typing import Optional -class IngestDebug(str, Enum): - r"""Flag to enable additional debug information in the endpoint response""" - TRUE = 'true' - FALSE = 'false' - @dataclasses.dataclass class IngestRequest: backfill_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'backfill_id', 'style': 'form', 'explode': True }}) r"""If this ingestion request is part of a backfill, this parameter ties the ingested events to the backfill""" - debug: Optional[IngestDebug] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'debug', 'style': 'form', 'explode': True }}) + debug: Optional[shared_debug.Debug] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'debug', 'style': 'form', 'explode': True }}) r"""Flag to enable additional debug information in the endpoint response""" request_body: Optional[list[shared_event.Event]] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) diff --git a/src/orb/models/shared/__init__.py b/src/orb/models/shared/__init__.py index 48417c8..7ee8482 100755 --- a/src/orb/models/shared/__init__.py +++ b/src/orb/models/shared/__init__.py @@ -70,7 +70,9 @@ from .transactiontype import * from .unitpriceoverride import * from .upcominginvoice import * +from .usage import * +from .usageitem import * from .validationerrors import * from .viewmode import * -__all__ = ["ActionType","AmendEventResult","AmendedEvent","AmendedUsage","BPSPriceOverride","BPSPriceOverrideBPSConfig","BPSPriceOverrideModelType","Backfill","BackfillStatus","Backfills","BillingAddress","BulkBPSPriceOverride","BulkBPSPriceOverrideBulkBPSConfig","BulkBPSPriceOverrideBulkBPSConfigTiers","BulkBPSPriceOverrideModelType","BulkPriceOverride","BulkPriceOverrideBulkConfig","BulkPriceOverrideBulkConfigTiers","BulkPriceOverrideModelType","Coupon","CouponInput","Coupons","Credit","CreditLedgerEntries","CreditLedgerEntriesPaginationMetadata","CreditLedgerEntry","CreditLedgerEntryCreditBlock","CreditLedgerEntryCustomer","CreditLedgerEntryEntryStatus","CreditLedgerEntryEntryType","CreditNote","CreditNoteCustomer","CreditNoteLineItem","CreditNoteLineItemSubLineItems","CreditNoteLineItemTaxAmounts","CreditNoteReason","CreditNoteType","CreditNotes","Credits","Customer","CustomerCost","CustomerCostPerPriceCosts","CustomerCostPerPriceCostsPriceGroups","CustomerCosts","CustomerTaxID","Customers","Debug","DeprecatedEventResult","Discount","DiscountType","DurationUnit","EntryStatus","EntryType","EntryType1","Event","EventSearchCriteria","EventSearchResults","FixedFeeQuantityChange","FixedFeeQuantityChangeChangeOption","IngestionResponse","Invoice","InvoiceAutoCollection","InvoiceCreditNotes","InvoiceCustomer","InvoiceLineItem","InvoiceLineItemTaxAmounts","InvoiceStatus","InvoiceSubscription","Invoices","MinimumAmount","NewBackfill","NewCreditLedgerEntry","NewCreditLedgerEntryInvoiceSettings","NewCustomer","NewInvoiceLineItem","NewSubscription","NewSubscriptionExternalMarketplace","NewTransaction","PackagePriceOverride","PackagePriceOverrideModelType","PackagePriceOverridePackageConfig","PaginationMetadata","PaymentProvider","PhaseOverride","Plan","PlanBasePlan","PlanPhase","PlanProduct","PlanTrialConfig","PlanTrialConfigTrialPeriodUnit","Plans","Price","PriceBillableMetric","PriceBpsConfig","PriceBulkBpsConfig","PriceBulkBpsConfigTiers","PriceBulkConfig","PriceBulkConfigTiers","PriceCadence","PriceMatrixConfig","PriceMatrixConfigMatrixValues","PriceModelType","PricePackageConfig","PriceTieredBpsConfig","PriceTieredBpsConfigTiers","PriceTieredConfig","PriceTieredConfigTiers","PriceUnitConfig","Security","ShippingAddress","SubLineItem","SubLineItemGrouping","SubLineItemMatrixConfig","SubLineItemTierConfig","SubLineItemType","Subscription","SubscriptionCancellation","SubscriptionCancellationCancelOption","SubscriptionCost","SubscriptionCostPerPriceCosts","SubscriptionCostPerPriceCostsPriceGroups","SubscriptionCosts","SubscriptionFixedFeeQuantitySchedule","SubscriptionPlanChange","SubscriptionPlanChangeChangeOption","SubscriptionRedeemedCoupon","SubscriptionSchedule","SubscriptionScheduleItem","SubscriptionScheduleItemPlan","SubscriptionStatus","SubscriptionUsage","SubscriptionUsageData","SubscriptionUsageDataModelType","SubscriptionUsageDataUsage","Subscriptions","TieredBPSPriceOverride","TieredBPSPriceOverrideModelType","TieredBPSPriceOverrideTieredBPSConfig","TieredBPSPriceOverrideTieredBPSConfigTiers","TieredPriceOverride","TieredPriceOverrideModelType","TieredPriceOverrideTieredConfig","TieredPriceOverrideTieredConfigTiers","Transaction","TransactionCreditNote","TransactionInvoice","TransactionType","Transactions","UnitPriceOverride","UnitPriceOverrideModelType","UnitPriceOverrideUnitConfig","UpcomingInvoice","UpcomingInvoiceCustomer","UpcomingInvoiceLineItems","UpcomingInvoiceLineItemsGrouping","UpcomingInvoiceLineItemsSubLineItems","UpcomingInvoiceLineItemsSubLineItemsMatrixConfig","UpcomingInvoiceLineItemsSubLineItemsTierConfig","UpcomingInvoiceLineItemsSubLineItemsType","UpcomingInvoiceSubscription","ValidationErrors","ViewMode"] +__all__ = ["ActionType","AdjustmentType","AmendEventResult","AmendedEvent","AmendedUsage","BPSPriceOverride","BPSPriceOverrideBPSConfig","Backfill","BackfillStatus","Backfills","BillingAddress","BpsModelType","BulkBPSPriceOverride","BulkBPSPriceOverrideBulkBPSConfig","BulkBPSPriceOverrideBulkBPSConfigTiers","BulkBpsModelType","BulkModelType","BulkPriceOverride","BulkPriceOverrideBulkConfig","BulkPriceOverrideBulkConfigTiers","Cadence","CancelOptions","ChangeOptions","Coupon","CouponInput","Coupons","Credit","CreditLedgerEntries","CreditLedgerEntriesPaginationMetadata","CreditLedgerEntry","CreditLedgerEntryCreditBlock","CreditLedgerEntryCustomer","CreditLedgerEntryEntryStatus","CreditLedgerEntryEntryType","CreditNote","CreditNoteCustomer","CreditNoteLineItem","CreditNoteLineItemSubLineItems","CreditNoteLineItemTaxAmounts","CreditNoteReason","CreditNotes","Credits","Customer","CustomerCost","CustomerCostPerPriceCosts","CustomerCostPerPriceCostsPriceGroups","CustomerCosts","CustomerTaxID","Customers","Debug","DeprecatedEventResult","Discount","DiscountType","DurationUnit","EntryStatus","EntryType","Event","EventSearchCriteria","EventSearchResults","ExternalMarketplace","FeeChangeOption","FixedFeeQuantityChange","IngestionResponse","Invoice","InvoiceAutoCollection","InvoiceCreditNotes","InvoiceCustomer","InvoiceLineItem","InvoiceLineItemTaxAmounts","InvoiceStatus","InvoiceSubscription","Invoices","MinimumAmount","ModelType","NewBackfill","NewCreditLedgerEntry","NewCreditLedgerEntryInvoiceSettings","NewCustomer","NewInvoiceLineItem","NewSubscription","NewTransaction","PackageModelType","PackagePriceOverride","PackagePriceOverridePackageConfig","PaginationMetadata","PaymentProvider","PhaseOverride","Plan","PlanBasePlan","PlanPhase","PlanProduct","PlanTrialConfig","PlanTrialConfigTrialPeriodUnit","Plans","Price","PriceBillableMetric","PriceBpsConfig","PriceBulkBpsConfig","PriceBulkBpsConfigTiers","PriceBulkConfig","PriceBulkConfigTiers","PriceMatrixConfig","PriceMatrixConfigMatrixValues","PriceModelType","PricePackageConfig","PriceTieredBpsConfig","PriceTieredBpsConfigTiers","PriceTieredConfig","PriceTieredConfigTiers","PriceUnitConfig","Security","ShippingAddress","SubLineItem","SubLineItemGrouping","SubLineItemMatrixConfig","SubLineItemTierConfig","SubLineItemType","Subscription","SubscriptionCancellation","SubscriptionCost","SubscriptionCostPerPriceCosts","SubscriptionCostPerPriceCostsPriceGroups","SubscriptionCosts","SubscriptionFixedFeeQuantitySchedule","SubscriptionPlanChange","SubscriptionRedeemedCoupon","SubscriptionSchedule","SubscriptionScheduleItem","SubscriptionScheduleItemPlan","SubscriptionStatus","SubscriptionUsage","Subscriptions","TieredBPSPriceOverride","TieredBPSPriceOverrideTieredBPSConfig","TieredBPSPriceOverrideTieredBPSConfigTiers","TieredBpsModelType","TieredModelType","TieredPriceOverride","TieredPriceOverrideTieredConfig","TieredPriceOverrideTieredConfigTiers","Transaction","TransactionCreditNote","TransactionInvoice","TransactionType","Transactions","UnitModelType","UnitPriceOverride","UnitPriceOverrideUnitConfig","UpcomingInvoice","UpcomingInvoiceCustomer","UpcomingInvoiceLineItems","UpcomingInvoiceLineItemsGrouping","UpcomingInvoiceLineItemsSubLineItems","UpcomingInvoiceLineItemsSubLineItemsMatrixConfig","UpcomingInvoiceLineItemsSubLineItemsTierConfig","UpcomingInvoiceLineItemsSubLineItemsType","UpcomingInvoiceSubscription","Usage","UsageItem","ValidationErrors","ViewMode"] diff --git a/src/orb/models/shared/bpspriceoverride.py b/src/orb/models/shared/bpspriceoverride.py index 2fc572f..513caeb 100755 --- a/src/orb/models/shared/bpspriceoverride.py +++ b/src/orb/models/shared/bpspriceoverride.py @@ -15,7 +15,7 @@ class BPSPriceOverrideBPSConfig: bps: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bps') }}) per_unit_maximum: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('per_unit_maximum') }}) -class BPSPriceOverrideModelType(str, Enum): +class BpsModelType(str, Enum): BPS = 'bps' @@ -26,7 +26,7 @@ class BPSPriceOverride: bps_config: BPSPriceOverrideBPSConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bps_config') }}) id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: BPSPriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: BpsModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" \ No newline at end of file diff --git a/src/orb/models/shared/bulkbpspriceoverride.py b/src/orb/models/shared/bulkbpspriceoverride.py index 5fbb937..54676f5 100755 --- a/src/orb/models/shared/bulkbpspriceoverride.py +++ b/src/orb/models/shared/bulkbpspriceoverride.py @@ -23,7 +23,7 @@ class BulkBPSPriceOverrideBulkBPSConfig: tiers: Optional[list[BulkBPSPriceOverrideBulkBPSConfigTiers]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tiers'), 'exclude': lambda f: f is None }}) -class BulkBPSPriceOverrideModelType(str, Enum): +class BulkBpsModelType(str, Enum): BULK_BPS = 'bulk_bps' @@ -33,7 +33,7 @@ class BulkBPSPriceOverride: r"""Bulk BPS price override""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: BulkBPSPriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: BulkBpsModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) bulk_bps_config: Optional[BulkBPSPriceOverrideBulkBPSConfig] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bulk_bps_config'), 'exclude': lambda f: f is None }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" diff --git a/src/orb/models/shared/bulkpriceoverride.py b/src/orb/models/shared/bulkpriceoverride.py index 3470d99..a150224 100755 --- a/src/orb/models/shared/bulkpriceoverride.py +++ b/src/orb/models/shared/bulkpriceoverride.py @@ -22,7 +22,7 @@ class BulkPriceOverrideBulkConfig: tiers: list[BulkPriceOverrideBulkConfigTiers] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tiers') }}) -class BulkPriceOverrideModelType(str, Enum): +class BulkModelType(str, Enum): BULK = 'bulk' @@ -33,7 +33,7 @@ class BulkPriceOverride: bulk_config: BulkPriceOverrideBulkConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bulk_config') }}) id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: BulkPriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: BulkModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" \ No newline at end of file diff --git a/src/orb/models/shared/creditnote.py b/src/orb/models/shared/creditnote.py index 0e66e83..0c3175c 100755 --- a/src/orb/models/shared/creditnote.py +++ b/src/orb/models/shared/creditnote.py @@ -27,7 +27,7 @@ class CreditNoteReason(str, Enum): ORDER_CHANGE = 'Order change' PRODUCT_UNSATISFACTORY = 'Product unsatisfactory' -class CreditNoteType(str, Enum): +class AdjustmentType(str, Enum): r"""Describing if this is an `adjustment` or a `refund`""" REFUND = 'refund' ADJUSTMENT = 'adjustment' @@ -63,7 +63,7 @@ class CreditNote: r"""The total prior to any creditable invoice-level discounts or minimums""" total: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('total') }}) r"""The total including creditable invoice-level discounts or minimums, and tax""" - type: CreditNoteType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + type: AdjustmentType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) r"""Describing if this is an `adjustment` or a `refund`""" voided_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('voided_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) r"""The time when the credit note was voided in Orb, if applicable.""" diff --git a/src/orb/models/shared/debug.py b/src/orb/models/shared/debug.py index 8ee6194..08985bd 100755 --- a/src/orb/models/shared/debug.py +++ b/src/orb/models/shared/debug.py @@ -12,6 +12,6 @@ class Debug: r"""Optional debug information (only present when debug=true is passed to the endpoint). Contains ingested and duplicate event idempotency keys.""" - duplicate: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('duplicate'), 'exclude': lambda f: f is None }}) - ingested: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ingested'), 'exclude': lambda f: f is None }}) + duplicate: Optional[list[str]] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'duplicate' }, 'dataclasses_json': { 'letter_case': utils.get_field_name('duplicate'), 'exclude': lambda f: f is None }}) + ingested: Optional[list[str]] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'ingested' }, 'dataclasses_json': { 'letter_case': utils.get_field_name('ingested'), 'exclude': lambda f: f is None }}) \ No newline at end of file diff --git a/src/orb/models/shared/entrytype.py b/src/orb/models/shared/entrytype.py index b4accf5..224e46e 100755 --- a/src/orb/models/shared/entrytype.py +++ b/src/orb/models/shared/entrytype.py @@ -4,7 +4,6 @@ from enum import Enum class EntryType(str, Enum): - r"""Filter to a single type of ledger entry""" INCREMENT = 'increment' DECREMENT = 'decrement' EXPIRATION_CHANGE = 'expiration_change' diff --git a/src/orb/models/shared/fixedfeequantitychange.py b/src/orb/models/shared/fixedfeequantitychange.py index a0187ca..cb20908 100755 --- a/src/orb/models/shared/fixedfeequantitychange.py +++ b/src/orb/models/shared/fixedfeequantitychange.py @@ -9,7 +9,7 @@ from orb import utils from typing import Optional -class FixedFeeQuantityChangeChangeOption(str, Enum): +class FeeChangeOption(str, Enum): r"""Determines when the change takes effect. Note that if `effective_date` is specified, this defautls to `effective_date`. Otherwise, this defaults to `immediate` unless it's explicitly set to `upcoming_invoice.""" IMMEDIATE = 'immediate' UPCOMING_INVOICE = 'upcoming_invoice' @@ -23,7 +23,7 @@ class FixedFeeQuantityChange: price_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('price_id') }}) r"""Price for which the quantity should be updated. Must be a fixed fee.""" quantity: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity') }}) - change_option: Optional[FixedFeeQuantityChangeChangeOption] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('change_option'), 'exclude': lambda f: f is None }}) + change_option: Optional[FeeChangeOption] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('change_option'), 'exclude': lambda f: f is None }}) r"""Determines when the change takes effect. Note that if `effective_date` is specified, this defautls to `effective_date`. Otherwise, this defaults to `immediate` unless it's explicitly set to `upcoming_invoice.""" effective_date: Optional[date] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('effective_date'), 'encoder': utils.dateisoformat(True), 'decoder': utils.datefromisoformat, 'mm_field': fields.DateTime(format='iso'), 'exclude': lambda f: f is None }}) r"""The date that the quantity change should take effect, localized to the customer's timezone. If this parameter is not passed in, the quantity change is effective immediately.""" diff --git a/src/orb/models/shared/newcreditledgerentry.py b/src/orb/models/shared/newcreditledgerentry.py index f3a2956..7630435 100755 --- a/src/orb/models/shared/newcreditledgerentry.py +++ b/src/orb/models/shared/newcreditledgerentry.py @@ -2,18 +2,13 @@ from __future__ import annotations import dataclasses +from ..shared import entrytype as shared_entrytype from dataclasses_json import Undefined, dataclass_json from datetime import date -from enum import Enum from marshmallow import fields from orb import utils from typing import Any, Optional -class EntryType1(str, Enum): - INCREMENT = 'increment' - DECREMENT = 'decrement' - EXPIRATION_CHANGE = 'expiration_change' - @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass @@ -32,7 +27,7 @@ class NewCreditLedgerEntryInvoiceSettings: @dataclasses.dataclass class NewCreditLedgerEntry: - entry_type: EntryType1 = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entry_type') }}) + entry_type: shared_entrytype.EntryType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entry_type') }}) amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'exclude': lambda f: f is None }}) r"""The number of credits to effect. Note that this is required for increment or decrement operations.""" block_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('block_id'), 'exclude': lambda f: f is None }}) diff --git a/src/orb/models/shared/newsubscription.py b/src/orb/models/shared/newsubscription.py index 066a585..f811a85 100755 --- a/src/orb/models/shared/newsubscription.py +++ b/src/orb/models/shared/newsubscription.py @@ -10,7 +10,7 @@ from orb import utils from typing import Any, Optional -class NewSubscriptionExternalMarketplace(str, Enum): +class ExternalMarketplace(str, Enum): r"""Optionally provide the name of the external marketplace that the subscription is attached to.""" GOOGLE = 'google' AWS = 'aws' @@ -33,7 +33,7 @@ class NewSubscription: r"""Invoices for this subscription will populate with this memo. When not set, the plan-level setting for memo will be used.""" external_customer_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_customer_id'), 'exclude': lambda f: f is None }}) r"""The external ID of the customer to subscribe, as an alternate to passing the `customer_id`.""" - external_marketplace: Optional[NewSubscriptionExternalMarketplace] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_marketplace'), 'exclude': lambda f: f is None }}) + external_marketplace: Optional[ExternalMarketplace] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_marketplace'), 'exclude': lambda f: f is None }}) r"""Optionally provide the name of the external marketplace that the subscription is attached to.""" external_marketplace_reporting_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_marketplace_reporting_id'), 'exclude': lambda f: f is None }}) r"""The reporting ID to associate this subscription with the external marketplace. Required if external_marketplace is specified.""" diff --git a/src/orb/models/shared/packagepriceoverride.py b/src/orb/models/shared/packagepriceoverride.py index b9bb982..4125b8b 100755 --- a/src/orb/models/shared/packagepriceoverride.py +++ b/src/orb/models/shared/packagepriceoverride.py @@ -7,7 +7,7 @@ from orb import utils from typing import Optional -class PackagePriceOverrideModelType(str, Enum): +class PackageModelType(str, Enum): PACKAGE = 'package' @@ -25,7 +25,7 @@ class PackagePriceOverride: r"""Package price override""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: PackagePriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: PackageModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) package_config: PackagePriceOverridePackageConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('package_config') }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" diff --git a/src/orb/models/shared/price.py b/src/orb/models/shared/price.py index bbd6bab..4a53328 100755 --- a/src/orb/models/shared/price.py +++ b/src/orb/models/shared/price.py @@ -61,7 +61,7 @@ class PriceBulkConfig: tiers: Optional[list[PriceBulkConfigTiers]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tiers'), 'exclude': lambda f: f is None }}) -class PriceCadence(str, Enum): +class Cadence(str, Enum): ANNUAL = 'annual' MONTHLY = 'monthly' QUARTERLY = 'quarterly' @@ -341,7 +341,7 @@ class Price: r"""Provided when model_type is `bulk_bps`""" bulk_config: Optional[PriceBulkConfig] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bulk_config'), 'exclude': lambda f: f is None }}) r"""Provided when model_type is `bulk`""" - cadence: Optional[PriceCadence] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cadence'), 'exclude': lambda f: f is None }}) + cadence: Optional[Cadence] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cadence'), 'exclude': lambda f: f is None }}) created_at: Optional[datetime] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created_at'), 'encoder': utils.datetimeisoformat(True), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso'), 'exclude': lambda f: f is None }}) fixed_price_quantity: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fixed_price_quantity'), 'exclude': lambda f: f is None }}) r"""If the Price represents a fixed cost, this represents the quantity of units applied. Mutually exclusive with billable_metric.""" diff --git a/src/orb/models/shared/subscriptioncancellation.py b/src/orb/models/shared/subscriptioncancellation.py index 6fd90f4..61a5aed 100755 --- a/src/orb/models/shared/subscriptioncancellation.py +++ b/src/orb/models/shared/subscriptioncancellation.py @@ -10,7 +10,7 @@ from orb import utils from typing import Optional -class SubscriptionCancellationCancelOption(str, Enum): +class CancelOptions(str, Enum): r"""Determines the timing of subscription cancellation""" IMMEDIATE = 'immediate' END_OF_SUBSCRIPTION_TERM = 'end_of_subscription_term' @@ -21,7 +21,7 @@ class SubscriptionCancellationCancelOption(str, Enum): @dataclasses.dataclass class SubscriptionCancellation: - cancel_option: SubscriptionCancellationCancelOption = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cancel_option') }}) + cancel_option: CancelOptions = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cancel_option') }}) r"""Determines the timing of subscription cancellation""" cancellation_date: Optional[datetime] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cancellation_date'), 'encoder': utils.datetimeisoformat(True), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso'), 'exclude': lambda f: f is None }}) r"""The date that the cancellation should take effect. This parameter can only be passed if the `cancel_option` is `requested_date`.""" diff --git a/src/orb/models/shared/subscriptionplanchange.py b/src/orb/models/shared/subscriptionplanchange.py index 5b5e838..51f4d18 100755 --- a/src/orb/models/shared/subscriptionplanchange.py +++ b/src/orb/models/shared/subscriptionplanchange.py @@ -10,7 +10,7 @@ from orb import utils from typing import Any, Optional -class SubscriptionPlanChangeChangeOption(str, Enum): +class ChangeOptions(str, Enum): r"""Determines the timing of the plan change""" REQUESTED_DATE = 'requested_date' END_OF_SUBSCRIPTION_TERM = 'end_of_subscription_term' @@ -21,7 +21,7 @@ class SubscriptionPlanChangeChangeOption(str, Enum): @dataclasses.dataclass class SubscriptionPlanChange: - change_option: SubscriptionPlanChangeChangeOption = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('change_option') }}) + change_option: ChangeOptions = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('change_option') }}) r"""Determines the timing of the plan change""" align_billing_with_plan_change_date: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('align_billing_with_plan_change_date'), 'exclude': lambda f: f is None }}) r"""Reset billing periods to be aligned with the plan change’s effective date.""" diff --git a/src/orb/models/shared/subscriptionusage.py b/src/orb/models/shared/subscriptionusage.py index 7f7de2c..ca09699 100755 --- a/src/orb/models/shared/subscriptionusage.py +++ b/src/orb/models/shared/subscriptionusage.py @@ -2,40 +2,16 @@ from __future__ import annotations import dataclasses -import dateutil.parser +from ..shared import usage as shared_usage from dataclasses_json import Undefined, dataclass_json -from datetime import datetime -from enum import Enum -from marshmallow import fields from orb import utils from typing import Optional -class SubscriptionUsageDataModelType(str, Enum): - USAGE = 'usage' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SubscriptionUsageDataUsage: - - quantity: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity') }}) - timeframe_end: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeframe_end'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - timeframe_start: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeframe_start'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SubscriptionUsageData: - - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: SubscriptionUsageDataModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) - usage: list[SubscriptionUsageDataUsage] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('usage') }}) - @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass class SubscriptionUsage: r"""OK""" - data: Optional[list[SubscriptionUsageData]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + data: Optional[list[shared_usage.Usage]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) \ No newline at end of file diff --git a/src/orb/models/shared/tieredbpspriceoverride.py b/src/orb/models/shared/tieredbpspriceoverride.py index 450acba..84a7d5e 100755 --- a/src/orb/models/shared/tieredbpspriceoverride.py +++ b/src/orb/models/shared/tieredbpspriceoverride.py @@ -7,7 +7,7 @@ from orb import utils from typing import Optional -class TieredBPSPriceOverrideModelType(str, Enum): +class TieredBpsModelType(str, Enum): TIERED_BPS = 'tiered_bps' @@ -34,7 +34,7 @@ class TieredBPSPriceOverride: r"""Tiered BPS price override""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: TieredBPSPriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: TieredBpsModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) tiered_bps_config: TieredBPSPriceOverrideTieredBPSConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tiered_bps_config') }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" diff --git a/src/orb/models/shared/tieredpriceoverride.py b/src/orb/models/shared/tieredpriceoverride.py index e8229eb..f226088 100755 --- a/src/orb/models/shared/tieredpriceoverride.py +++ b/src/orb/models/shared/tieredpriceoverride.py @@ -7,7 +7,7 @@ from orb import utils from typing import Optional -class TieredPriceOverrideModelType(str, Enum): +class TieredModelType(str, Enum): TIERED = 'tiered' @@ -34,7 +34,7 @@ class TieredPriceOverride: id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""price_id""" - model_type: TieredPriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: TieredModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) tiered_config: TieredPriceOverrideTieredConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tiered_config') }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" diff --git a/src/orb/models/shared/unitpriceoverride.py b/src/orb/models/shared/unitpriceoverride.py index 659bf7d..58d9832 100755 --- a/src/orb/models/shared/unitpriceoverride.py +++ b/src/orb/models/shared/unitpriceoverride.py @@ -7,7 +7,7 @@ from orb import utils from typing import Optional -class UnitPriceOverrideModelType(str, Enum): +class UnitModelType(str, Enum): UNIT = 'unit' @@ -24,7 +24,7 @@ class UnitPriceOverride: r"""Unit price override""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - model_type: UnitPriceOverrideModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + model_type: UnitModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) unit_config: UnitPriceOverrideUnitConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unit_config') }}) minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount'), 'exclude': lambda f: f is None }}) r"""The subscription's override minimum amount for this price.""" diff --git a/src/orb/models/shared/usage.py b/src/orb/models/shared/usage.py new file mode 100755 index 0000000..fdc304d --- /dev/null +++ b/src/orb/models/shared/usage.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import usageitem as shared_usageitem +from dataclasses_json import Undefined, dataclass_json +from enum import Enum +from orb import utils + +class ModelType(str, Enum): + USAGE = 'usage' + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class Usage: + + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + model_type: ModelType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('model_type') }}) + usage: list[shared_usageitem.UsageItem] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('usage') }}) + \ No newline at end of file diff --git a/src/orb/models/shared/usageitem.py b/src/orb/models/shared/usageitem.py new file mode 100755 index 0000000..79473ec --- /dev/null +++ b/src/orb/models/shared/usageitem.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import dateutil.parser +from dataclasses_json import Undefined, dataclass_json +from datetime import datetime +from marshmallow import fields +from orb import utils + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class UsageItem: + + quantity: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity') }}) + timeframe_end: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeframe_end'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) + timeframe_start: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeframe_start'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) + \ No newline at end of file diff --git a/src/orb/sdk.py b/src/orb/sdk.py index 95fd498..cb9e25a 100755 --- a/src/orb/sdk.py +++ b/src/orb/sdk.py @@ -50,7 +50,7 @@ class Orb: _security_client: requests_http.Session _server_url: str = SERVERS[0] _language: str = "python" - _sdk_version: str = "0.12.4" + _sdk_version: str = "0.12.5" _gen_version: str = "2.34.7" def __init__(self,