paddle-python-sdk 1.6.0__py3-none-any.whl → 1.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paddle_billing/Client.py +16 -10
- paddle_billing/Entities/Address.py +2 -1
- paddle_billing/Entities/Adjustment.py +2 -1
- paddle_billing/Entities/AdjustmentCreditNote.py +2 -1
- paddle_billing/Entities/Adjustments/AdjustmentCustomerBalance.py +2 -1
- paddle_billing/Entities/Adjustments/AdjustmentItem.py +2 -1
- paddle_billing/Entities/Adjustments/AdjustmentTaxRatesUsed.py +2 -1
- paddle_billing/Entities/Adjustments/AdjustmentTotals.py +2 -1
- paddle_billing/Entities/Business.py +2 -1
- paddle_billing/Entities/Collections/AddressCollection.py +2 -1
- paddle_billing/Entities/Collections/AdjustmentCollection.py +2 -1
- paddle_billing/Entities/Collections/BusinessCollection.py +2 -1
- paddle_billing/Entities/Collections/CreditBalanceCollection.py +2 -1
- paddle_billing/Entities/Collections/CustomerCollection.py +2 -1
- paddle_billing/Entities/Collections/DiscountCollection.py +2 -1
- paddle_billing/Entities/Collections/DiscountGroupCollection.py +14 -0
- paddle_billing/Entities/Collections/EventCollection.py +2 -1
- paddle_billing/Entities/Collections/EventTypeCollection.py +2 -1
- paddle_billing/Entities/Collections/NotificationCollection.py +2 -1
- paddle_billing/Entities/Collections/NotificationLogCollection.py +4 -1
- paddle_billing/Entities/Collections/NotificationSettingCollection.py +4 -1
- paddle_billing/Entities/Collections/Paginator.py +1 -1
- paddle_billing/Entities/Collections/PaymentMethodCollection.py +2 -1
- paddle_billing/Entities/Collections/PriceCollection.py +2 -1
- paddle_billing/Entities/Collections/ProductCollection.py +2 -1
- paddle_billing/Entities/Collections/ReportCollection.py +2 -1
- paddle_billing/Entities/Collections/SimulationCollection.py +2 -1
- paddle_billing/Entities/Collections/SimulationRunCollection.py +2 -1
- paddle_billing/Entities/Collections/SimulationRunEventCollection.py +4 -1
- paddle_billing/Entities/Collections/SimulationTypeCollection.py +4 -1
- paddle_billing/Entities/Collections/SubscriptionCollection.py +2 -1
- paddle_billing/Entities/Collections/SubscriptionPreviewCollection.py +2 -1
- paddle_billing/Entities/Collections/TransactionCollection.py +2 -1
- paddle_billing/Entities/Collections/TransactionPreviewCollection.py +4 -1
- paddle_billing/Entities/Collections/TransactionsDataCollection.py +4 -1
- paddle_billing/Entities/Collections/__init__.py +1 -0
- paddle_billing/Entities/CreditBalance.py +2 -1
- paddle_billing/Entities/Customer.py +2 -1
- paddle_billing/Entities/CustomerAuthToken.py +2 -1
- paddle_billing/Entities/CustomerPortalSession.py +2 -1
- paddle_billing/Entities/CustomerPortalSessions/CustomerPortalSessionGeneralUrl.py +2 -1
- paddle_billing/Entities/CustomerPortalSessions/CustomerPortalSessionSubscriptionUrl.py +2 -1
- paddle_billing/Entities/CustomerPortalSessions/CustomerPortalSessionUrls.py +2 -1
- paddle_billing/Entities/Discount.py +11 -2
- paddle_billing/Entities/DiscountGroup.py +30 -0
- paddle_billing/Entities/DiscountGroups/DiscountGroupStatus.py +6 -0
- paddle_billing/Entities/DiscountGroups/__init__.py +1 -0
- paddle_billing/Entities/Discounts/DiscountMode.py +6 -0
- paddle_billing/Entities/Discounts/__init__.py +1 -0
- paddle_billing/Entities/Entity.py +2 -1
- paddle_billing/Entities/Event.py +2 -1
- paddle_billing/Entities/EventType.py +3 -2
- paddle_billing/Entities/Events/EventTypeName.py +6 -0
- paddle_billing/Entities/IPAddresses.py +2 -1
- paddle_billing/Entities/Notification.py +2 -1
- paddle_billing/Entities/NotificationLog.py +2 -1
- paddle_billing/Entities/NotificationSetting.py +2 -1
- paddle_billing/Entities/Notifications/NotificationEvent.py +4 -1
- paddle_billing/Entities/Notifications/NotificationPayout.py +2 -1
- paddle_billing/Entities/PaymentMethod.py +9 -1
- paddle_billing/Entities/Price.py +2 -1
- paddle_billing/Entities/PricePreview.py +2 -1
- paddle_billing/Entities/PricingPreviews/PricePreviewDetails.py +2 -1
- paddle_billing/Entities/PricingPreviews/PricePreviewDiscounts.py +2 -1
- paddle_billing/Entities/PricingPreviews/PricePreviewItem.py +2 -1
- paddle_billing/Entities/PricingPreviews/PricePreviewLineItem.py +2 -1
- paddle_billing/Entities/PricingPreviews/PricePreviewTotalsFormatted.py +2 -1
- paddle_billing/Entities/PricingPreviews/PricePreviewUnitTotalsFormatted.py +2 -1
- paddle_billing/Entities/Product.py +2 -1
- paddle_billing/Entities/Report.py +2 -1
- paddle_billing/Entities/ReportCSV.py +2 -1
- paddle_billing/Entities/Reports/BalanceReportType.py +7 -0
- paddle_billing/Entities/Reports/ReportFilter.py +3 -2
- paddle_billing/Entities/Reports/ReportType.py +1 -0
- paddle_billing/Entities/Reports/__init__.py +1 -0
- paddle_billing/Entities/Shared/Action.py +1 -0
- paddle_billing/Entities/Shared/AddressPreview.py +2 -1
- paddle_billing/Entities/Shared/AdjustmentItemTotals.py +2 -1
- paddle_billing/Entities/Shared/AdjustmentTaxMode.py +6 -0
- paddle_billing/Entities/Shared/AdjustmentTotals.py +2 -1
- paddle_billing/Entities/Shared/BillingDetails.py +2 -1
- paddle_billing/Entities/Shared/Card.py +2 -1
- paddle_billing/Entities/Shared/ChargebackFee.py +2 -1
- paddle_billing/Entities/Shared/Checkout.py +2 -1
- paddle_billing/Entities/Shared/Contacts.py +2 -1
- paddle_billing/Entities/Shared/CustomData.py +5 -2
- paddle_billing/Entities/Shared/Data.py +1 -1
- paddle_billing/Entities/Shared/Duration.py +2 -1
- paddle_billing/Entities/Shared/ImportMeta.py +2 -1
- paddle_billing/Entities/Shared/KoreaLocalPaymentMethodType.py +32 -0
- paddle_billing/Entities/Shared/KoreaLocalUnderlyingDetails.py +16 -0
- paddle_billing/Entities/Shared/MetaPaginated.py +2 -1
- paddle_billing/Entities/Shared/MethodDetails.py +9 -1
- paddle_billing/Entities/Shared/Money.py +2 -1
- paddle_billing/Entities/Shared/Original.py +2 -1
- paddle_billing/Entities/Shared/Pagination.py +2 -1
- paddle_billing/Entities/Shared/PaymentMethodType.py +1 -0
- paddle_billing/Entities/Shared/PaymentMethodUnderlyingDetails.py +16 -0
- paddle_billing/Entities/Shared/PayoutTotalsAdjustment.py +2 -1
- paddle_billing/Entities/Shared/Paypal.py +2 -1
- paddle_billing/Entities/Shared/PriceQuantity.py +2 -1
- paddle_billing/Entities/Shared/Proration.py +2 -1
- paddle_billing/Entities/Shared/SavedPaymentMethodType.py +1 -0
- paddle_billing/Entities/Shared/TaxRatesUsed.py +2 -1
- paddle_billing/Entities/Shared/TimePeriod.py +2 -1
- paddle_billing/Entities/Shared/Totals.py +2 -1
- paddle_billing/Entities/Shared/TransactionDetailsPreview.py +2 -1
- paddle_billing/Entities/Shared/TransactionLineItemPreview.py +2 -1
- paddle_billing/Entities/Shared/TransactionPaymentAttempt.py +2 -1
- paddle_billing/Entities/Shared/TransactionPayoutTotals.py +2 -1
- paddle_billing/Entities/Shared/TransactionPayoutTotalsAdjusted.py +2 -1
- paddle_billing/Entities/Shared/TransactionPreviewProduct.py +2 -1
- paddle_billing/Entities/Shared/TransactionTotals.py +2 -1
- paddle_billing/Entities/Shared/TransactionTotalsAdjusted.py +2 -1
- paddle_billing/Entities/Shared/UnitPriceOverride.py +2 -1
- paddle_billing/Entities/Shared/UnitTotals.py +2 -1
- paddle_billing/Entities/Shared/__init__.py +4 -0
- paddle_billing/Entities/Simulation.py +5 -1
- paddle_billing/Entities/SimulationRun.py +2 -1
- paddle_billing/Entities/SimulationRunEvent.py +2 -1
- paddle_billing/Entities/SimulationRunEvents/SimulationRunEventRequest.py +2 -1
- paddle_billing/Entities/SimulationRunEvents/SimulationRunEventResponse.py +2 -1
- paddle_billing/Entities/SimulationType.py +2 -1
- paddle_billing/Entities/Simulations/Config/Options/BusinessSimulatedAs.py +7 -0
- paddle_billing/Entities/Simulations/Config/Options/CustomerSimulatedAs.py +7 -0
- paddle_billing/Entities/Simulations/Config/Options/DiscountSimulatedAs.py +7 -0
- paddle_billing/Entities/Simulations/Config/Options/DunningExhaustedAction.py +6 -0
- paddle_billing/Entities/Simulations/Config/Options/EffectiveFrom.py +6 -0
- paddle_billing/Entities/Simulations/Config/Options/PaymentOutcome.py +8 -0
- paddle_billing/Entities/Simulations/Config/Options/__init__.py +6 -0
- paddle_billing/Entities/Simulations/Config/SimulationConfig.py +49 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Cancellation/SubscriptionCancellationConfig.py +24 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Cancellation/SubscriptionCancellationEntities.py +16 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Cancellation/SubscriptionCancellationOptions.py +19 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Cancellation/__init__.py +9 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Creation/SubscriptionCreationConfig.py +24 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Creation/SubscriptionCreationEntities.py +33 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Creation/SubscriptionCreationItem.py +18 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Creation/SubscriptionCreationOptions.py +25 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Creation/__init__.py +12 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Pause/SubscriptionPauseConfig.py +24 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Pause/SubscriptionPauseEntities.py +16 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Pause/SubscriptionPauseOptions.py +19 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Pause/__init__.py +9 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Renewal/SubscriptionRenewalConfig.py +24 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Renewal/SubscriptionRenewalEntities.py +16 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Renewal/SubscriptionRenewalOptions.py +23 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Renewal/__init__.py +9 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Resume/SubscriptionResumeConfig.py +24 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Resume/SubscriptionResumeEntities.py +16 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Resume/SubscriptionResumeOptions.py +23 -0
- paddle_billing/Entities/Simulations/Config/Subscription/Resume/__init__.py +9 -0
- paddle_billing/Entities/Simulations/Config/Subscription/__init__.py +0 -0
- paddle_billing/Entities/Simulations/Config/__init__.py +1 -0
- paddle_billing/Entities/Subscription.py +2 -1
- paddle_billing/Entities/SubscriptionPreview.py +3 -2
- paddle_billing/Entities/Subscriptions/SubscriptionAdjustmentItem.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionAdjustmentPreview.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionCharge.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionCredit.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionDiscount.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionItem.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionManagementUrls.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionNextTransaction.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionPreviewSubscriptionUpdateSummary.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionResult.py +2 -1
- paddle_billing/Entities/Subscriptions/SubscriptionScheduledChange.py +2 -1
- paddle_billing/Entities/Transaction.py +3 -2
- paddle_billing/Entities/TransactionData.py +2 -1
- paddle_billing/Entities/TransactionPreview.py +2 -1
- paddle_billing/Entities/Transactions/TransactionAdjustmentsTotals.py +2 -1
- paddle_billing/Entities/Transactions/TransactionBreakdown.py +2 -1
- paddle_billing/Entities/Transactions/TransactionDetails.py +2 -1
- paddle_billing/Entities/Transactions/TransactionItem.py +2 -1
- paddle_billing/Entities/Transactions/TransactionItemPreviewWithPrice.py +2 -1
- paddle_billing/Entities/Transactions/TransactionLineItem.py +2 -1
- paddle_billing/Entities/Transactions/TransactionPreviewPrice.py +3 -2
- paddle_billing/Exceptions/SdkExceptions/InvalidArgumentException.py +7 -1
- paddle_billing/FiltersNone.py +4 -1
- paddle_billing/FiltersUndefined.py +2 -1
- paddle_billing/HasParameters.py +1 -1
- paddle_billing/Notifications/Entities/Address.py +2 -1
- paddle_billing/Notifications/Entities/Adjustment.py +2 -1
- paddle_billing/Notifications/Entities/Adjustments/AdjustmentItem.py +2 -1
- paddle_billing/Notifications/Entities/Adjustments/AdjustmentTaxRatesUsed.py +2 -1
- paddle_billing/Notifications/Entities/Adjustments/AdjustmentTotals.py +2 -1
- paddle_billing/Notifications/Entities/ApiKey.py +36 -0
- paddle_billing/Notifications/Entities/ApiKeys/ApiKeyPermission.py +34 -0
- paddle_billing/Notifications/Entities/ApiKeys/ApiKeyStatus.py +7 -0
- paddle_billing/Notifications/Entities/ApiKeys/__init__.py +2 -0
- paddle_billing/Notifications/Entities/Business.py +2 -1
- paddle_billing/Notifications/Entities/Businesses/BusinessesContacts.py +2 -1
- paddle_billing/Notifications/Entities/Customer.py +2 -1
- paddle_billing/Notifications/Entities/Discount.py +8 -3
- paddle_billing/Notifications/Entities/DiscountGroup.py +31 -0
- paddle_billing/Notifications/Entities/DiscountGroups/DiscountGroupStatus.py +6 -0
- paddle_billing/Notifications/Entities/DiscountGroups/__init__.py +1 -0
- paddle_billing/Notifications/Entities/Discounts/DiscountMode.py +6 -0
- paddle_billing/Notifications/Entities/Discounts/__init__.py +1 -0
- paddle_billing/Notifications/Entities/Entity.py +5 -4
- paddle_billing/Notifications/Entities/EntityDict.py +2 -2
- paddle_billing/Notifications/Entities/PaymentMethod.py +2 -1
- paddle_billing/Notifications/Entities/PaymentMethodDeleted.py +2 -1
- paddle_billing/Notifications/Entities/Payout.py +2 -1
- paddle_billing/Notifications/Entities/Price.py +2 -1
- paddle_billing/Notifications/Entities/Product.py +2 -1
- paddle_billing/Notifications/Entities/Report.py +2 -1
- paddle_billing/Notifications/Entities/Reports/ReportFilter.py +3 -2
- paddle_billing/Notifications/Entities/Reports/ReportType.py +1 -0
- paddle_billing/Notifications/Entities/Shared/AddressPreview.py +2 -1
- paddle_billing/Notifications/Entities/Shared/AdjustmentItemTotals.py +2 -1
- paddle_billing/Notifications/Entities/Shared/AdjustmentTotals.py +2 -1
- paddle_billing/Notifications/Entities/Shared/BillingDetails.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Card.py +2 -1
- paddle_billing/Notifications/Entities/Shared/ChargebackFee.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Checkout.py +2 -1
- paddle_billing/Notifications/Entities/Shared/CustomData.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Data.py +1 -1
- paddle_billing/Notifications/Entities/Shared/Duration.py +2 -1
- paddle_billing/Notifications/Entities/Shared/ImportMeta.py +2 -1
- paddle_billing/Notifications/Entities/Shared/KoreaLocalPaymentMethodType.py +32 -0
- paddle_billing/Notifications/Entities/Shared/KoreaLocalUnderlyingDetails.py +16 -0
- paddle_billing/Notifications/Entities/Shared/MethodDetails.py +9 -1
- paddle_billing/Notifications/Entities/Shared/Money.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Original.py +2 -1
- paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py +1 -1
- paddle_billing/Notifications/Entities/Shared/PaymentMethodUnderlyingDetails.py +16 -0
- paddle_billing/Notifications/Entities/Shared/PayoutTotalsAdjustment.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Paypal.py +2 -1
- paddle_billing/Notifications/Entities/Shared/PriceQuantity.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Proration.py +2 -1
- paddle_billing/Notifications/Entities/Shared/SavedPaymentMethodType.py +1 -0
- paddle_billing/Notifications/Entities/Shared/TaxRatesUsed.py +2 -1
- paddle_billing/Notifications/Entities/Shared/TimePeriod.py +2 -1
- paddle_billing/Notifications/Entities/Shared/Totals.py +2 -1
- paddle_billing/Notifications/Entities/Shared/TransactionPaymentAttempt.py +2 -1
- paddle_billing/Notifications/Entities/Shared/TransactionPayoutTotals.py +2 -1
- paddle_billing/Notifications/Entities/Shared/TransactionPayoutTotalsAdjusted.py +2 -1
- paddle_billing/Notifications/Entities/Shared/TransactionTotals.py +2 -1
- paddle_billing/Notifications/Entities/Shared/TransactionTotalsAdjusted.py +2 -1
- paddle_billing/Notifications/Entities/Shared/UnitPriceOverride.py +2 -1
- paddle_billing/Notifications/Entities/Shared/UnitTotals.py +2 -1
- paddle_billing/Notifications/Entities/Shared/__init__.py +1 -0
- paddle_billing/Notifications/Entities/Simulations/Address.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Adjustment.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/ApiKey.py +49 -0
- paddle_billing/Notifications/Entities/Simulations/Business.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Customer.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Discount.py +8 -2
- paddle_billing/Notifications/Entities/Simulations/DiscountGroup.py +36 -0
- paddle_billing/Notifications/Entities/Simulations/PaymentMethod.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/PaymentMethodDeleted.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Payout.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Price.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Product.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Report.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/SimulationEntity.py +3 -2
- paddle_billing/Notifications/Entities/Simulations/Subscription.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/SubscriptionCreated.py +2 -1
- paddle_billing/Notifications/Entities/Simulations/Transaction.py +2 -1
- paddle_billing/Notifications/Entities/Subscription.py +2 -1
- paddle_billing/Notifications/Entities/SubscriptionCreated.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionAdjustmentItem.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionCharge.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionCredit.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionDiscount.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItem.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionPrice.py +2 -1
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChange.py +2 -1
- paddle_billing/Notifications/Entities/Transaction.py +2 -1
- paddle_billing/Notifications/Entities/Transactions/TransactionAdjustmentsTotals.py +2 -1
- paddle_billing/Notifications/Entities/Transactions/TransactionBreakdown.py +2 -1
- paddle_billing/Notifications/Entities/Transactions/TransactionDetails.py +2 -1
- paddle_billing/Notifications/Entities/Transactions/TransactionItem.py +2 -1
- paddle_billing/Notifications/Entities/Transactions/TransactionLineItem.py +2 -1
- paddle_billing/Notifications/Entities/UndefinedEntity.py +6 -2
- paddle_billing/Notifications/Events/ApiKeyCreated.py +17 -0
- paddle_billing/Notifications/Events/ApiKeyExpired.py +17 -0
- paddle_billing/Notifications/Events/ApiKeyExpiring.py +17 -0
- paddle_billing/Notifications/Events/ApiKeyRevoked.py +17 -0
- paddle_billing/Notifications/Events/ApiKeyUpdated.py +17 -0
- paddle_billing/Notifications/Events/DiscountGroupCreated.py +17 -0
- paddle_billing/Notifications/PaddleSignature.py +4 -2
- paddle_billing/Notifications/Verifier.py +3 -0
- paddle_billing/PaddleStrEnum.py +8 -5
- paddle_billing/RecursivelyRemoveKey.py +4 -1
- paddle_billing/Resources/Addresses/AddressesClient.py +5 -5
- paddle_billing/Resources/Addresses/Operations/ListAddresses.py +1 -1
- paddle_billing/Resources/Adjustments/AdjustmentsClient.py +5 -5
- paddle_billing/Resources/Adjustments/Operations/CreateAdjustment.py +6 -1
- paddle_billing/Resources/Adjustments/Operations/GetCreditNote.py +1 -1
- paddle_billing/Resources/Adjustments/Operations/ListAdjustments.py +6 -6
- paddle_billing/Resources/Businesses/BusinessesClient.py +5 -5
- paddle_billing/Resources/Businesses/Operations/ListBusinesses.py +3 -3
- paddle_billing/Resources/CustomerPortalSessions/CustomerPortalSessionsClient.py +1 -1
- paddle_billing/Resources/Customers/CustomersClient.py +8 -8
- paddle_billing/Resources/Customers/Operations/ListCreditBalances.py +2 -2
- paddle_billing/Resources/Customers/Operations/ListCustomers.py +4 -4
- paddle_billing/Resources/DiscountGroups/DiscountGroupsClient.py +33 -0
- paddle_billing/Resources/DiscountGroups/Operations/CreateDiscountGroup.py +8 -0
- paddle_billing/Resources/DiscountGroups/Operations/ListDiscountGroups.py +34 -0
- paddle_billing/Resources/DiscountGroups/Operations/__init__.py +2 -0
- paddle_billing/Resources/DiscountGroups/__init__.py +0 -0
- paddle_billing/Resources/Discounts/DiscountsClient.py +11 -8
- paddle_billing/Resources/Discounts/Operations/CreateDiscount.py +3 -1
- paddle_billing/Resources/Discounts/Operations/DiscountInclude.py +5 -0
- paddle_billing/Resources/Discounts/Operations/GetDiscount.py +32 -0
- paddle_billing/Resources/Discounts/Operations/ListDiscounts.py +20 -4
- paddle_billing/Resources/Discounts/Operations/UpdateDiscount.py +3 -1
- paddle_billing/Resources/Discounts/Operations/__init__.py +2 -0
- paddle_billing/Resources/EventTypes/EventTypesClient.py +1 -1
- paddle_billing/Resources/Events/EventsClient.py +2 -2
- paddle_billing/Resources/Events/Operations/ListEvents.py +1 -1
- paddle_billing/Resources/IPAddresses/IPAddressesClient.py +1 -1
- paddle_billing/Resources/NotificationLogs/NotificationLogsClient.py +2 -2
- paddle_billing/Resources/NotificationLogs/Operations/ListNotificationLogs.py +2 -2
- paddle_billing/Resources/NotificationSettings/NotificationSettingsClient.py +4 -4
- paddle_billing/Resources/NotificationSettings/Operations/ListNotificationSettings.py +1 -1
- paddle_billing/Resources/Notifications/NotificationsClient.py +3 -3
- paddle_billing/Resources/Notifications/Operations/ListNotifications.py +3 -3
- paddle_billing/Resources/PaymentMethods/Operations/ListPaymentMethods.py +3 -3
- paddle_billing/Resources/PaymentMethods/PaymentMethodsClient.py +3 -3
- paddle_billing/Resources/Prices/Operations/ListPrices.py +6 -6
- paddle_billing/Resources/Prices/PricesClient.py +5 -5
- paddle_billing/Resources/PricingPreviews/PricingPreviewsClient.py +1 -1
- paddle_billing/Resources/Products/Operations/ListProducts.py +7 -7
- paddle_billing/Resources/Products/ProductsClient.py +5 -5
- paddle_billing/Resources/Reports/Operations/CreateAdjustmentsReport.py +3 -1
- paddle_billing/Resources/Reports/Operations/CreateBalanceReport.py +22 -0
- paddle_billing/Resources/Reports/Operations/CreateDiscountsReport.py +1 -1
- paddle_billing/Resources/Reports/Operations/CreateProductsAndPricesReport.py +3 -1
- paddle_billing/Resources/Reports/Operations/CreateReport.py +4 -3
- paddle_billing/Resources/Reports/Operations/CreateTransactionsReport.py +5 -1
- paddle_billing/Resources/Reports/Operations/Filters/Filter.py +1 -1
- paddle_billing/Resources/Reports/Operations/ListReports.py +2 -2
- paddle_billing/Resources/Reports/Operations/__init__.py +1 -0
- paddle_billing/Resources/Reports/ReportsClient.py +5 -5
- paddle_billing/Resources/Shared/Operations/List/Pager.py +1 -1
- paddle_billing/Resources/SimulationRunEvents/Operations/ListSimulationRunEvents.py +2 -2
- paddle_billing/Resources/SimulationRunEvents/SimulationRunEventsClient.py +4 -4
- paddle_billing/Resources/SimulationRuns/Operations/GetSimulationRun.py +2 -2
- paddle_billing/Resources/SimulationRuns/Operations/ListSimulationRuns.py +3 -3
- paddle_billing/Resources/SimulationRuns/SimulationRunsClient.py +7 -5
- paddle_billing/Resources/SimulationTypes/SimulationTypesClient.py +1 -1
- paddle_billing/Resources/Simulations/Operations/Config/SimulationConfigCreate.py +13 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Cancellation/SubscriptionCancellationConfigCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Cancellation/SubscriptionCancellationEntitiesCreate.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Cancellation/SubscriptionCancellationOptionsCreate.py +11 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Cancellation/__init__.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Creation/SubscriptionCreationConfigCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Creation/SubscriptionCreationEntitiesCreate.py +23 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Creation/SubscriptionCreationItemCreate.py +8 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Creation/SubscriptionCreationOptionsCreate.py +16 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Creation/__init__.py +12 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Pause/SubscriptionPauseConfigCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Pause/SubscriptionPauseEntitiesCreate.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Pause/SubscriptionPauseOptionsCreate.py +11 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Pause/__init__.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Renewal/SubscriptionRenewalConfigCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Renewal/SubscriptionRenewalEntitiesCreate.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Renewal/SubscriptionRenewalOptionsCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Renewal/__init__.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Resume/SubscriptionResumeConfigCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Resume/SubscriptionResumeEntitiesCreate.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Resume/SubscriptionResumeOptionsCreate.py +32 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/Resume/__init__.py +9 -0
- paddle_billing/Resources/Simulations/Operations/Config/Subscription/__init__.py +0 -0
- paddle_billing/Resources/Simulations/Operations/Config/__init__.py +1 -0
- paddle_billing/Resources/Simulations/Operations/CreateSimulation.py +9 -0
- paddle_billing/Resources/Simulations/Operations/ListSimulations.py +4 -4
- paddle_billing/Resources/Simulations/Operations/UpdateSimulation.py +7 -0
- paddle_billing/Resources/Simulations/SimulationsClient.py +5 -5
- paddle_billing/Resources/Subscriptions/Operations/ListSubscriptions.py +8 -8
- paddle_billing/Resources/Subscriptions/SubscriptionsClient.py +12 -12
- paddle_billing/Resources/Transactions/Operations/GetTransactionInvoice.py +1 -1
- paddle_billing/Resources/Transactions/Operations/ListTransactions.py +9 -9
- paddle_billing/Resources/Transactions/TransactionsClient.py +9 -11
- paddle_billing/ResponseParser.py +12 -5
- {paddle_python_sdk-1.6.0.dist-info → paddle_python_sdk-1.7.0.dist-info}/METADATA +4 -3
- {paddle_python_sdk-1.6.0.dist-info → paddle_python_sdk-1.7.0.dist-info}/RECORD +391 -297
- {paddle_python_sdk-1.6.0.dist-info → paddle_python_sdk-1.7.0.dist-info}/WHEEL +1 -1
- tests/Functional/Resources/Adjustments/test_AdjustmentsClient.py +50 -1
- tests/Functional/Resources/DiscountGroups/__init__.py +0 -0
- tests/Functional/Resources/DiscountGroups/test_DiscountGroupsClient.py +125 -0
- tests/Functional/Resources/Discounts/test_DiscountsClient.py +85 -3
- tests/Functional/Resources/PaymentMethods/test_PaymentMethodsClient.py +50 -1
- tests/Functional/Resources/Reports/test_ReportsClient.py +14 -0
- tests/Functional/Resources/Simulations/test_SimulationsClient.py +761 -5
- tests/Unit/PaddleStrEnum/test_PaddleStrEnum.py +1 -1
- {paddle_python_sdk-1.6.0.dist-info → paddle_python_sdk-1.7.0.dist-info/licenses}/LICENSE +0 -0
- {paddle_python_sdk-1.6.0.dist-info → paddle_python_sdk-1.7.0.dist-info}/top_level.txt +0 -0
paddle_billing/Client.py
CHANGED
|
@@ -2,6 +2,7 @@ from json import dumps as json_dumps
|
|
|
2
2
|
from logging import Logger, getLogger
|
|
3
3
|
from requests import Response, RequestException, Session
|
|
4
4
|
from requests.adapters import HTTPAdapter
|
|
5
|
+
from typing import Any
|
|
5
6
|
from urllib3.util.retry import Retry
|
|
6
7
|
from urllib.parse import urljoin, urlencode
|
|
7
8
|
from uuid import uuid4
|
|
@@ -19,6 +20,7 @@ from paddle_billing.Resources.Adjustments.AdjustmentsClient import AdjustmentsCl
|
|
|
19
20
|
from paddle_billing.Resources.Businesses.BusinessesClient import BusinessesClient
|
|
20
21
|
from paddle_billing.Resources.Customers.CustomersClient import CustomersClient
|
|
21
22
|
from paddle_billing.Resources.CustomerPortalSessions.CustomerPortalSessionsClient import CustomerPortalSessionsClient
|
|
23
|
+
from paddle_billing.Resources.DiscountGroups.DiscountGroupsClient import DiscountGroupsClient
|
|
22
24
|
from paddle_billing.Resources.Discounts.DiscountsClient import DiscountsClient
|
|
23
25
|
from paddle_billing.Resources.Events.EventsClient import EventsClient
|
|
24
26
|
from paddle_billing.Resources.EventTypes.EventTypesClient import EventTypesClient
|
|
@@ -47,9 +49,9 @@ class Client:
|
|
|
47
49
|
def __init__(
|
|
48
50
|
self,
|
|
49
51
|
api_key: str,
|
|
50
|
-
options: Options = None,
|
|
51
|
-
http_client: Session = None,
|
|
52
|
-
logger: Logger = None,
|
|
52
|
+
options: Options | None = None,
|
|
53
|
+
http_client: Session | None = None,
|
|
54
|
+
logger: Logger | None = None,
|
|
53
55
|
retry_count: int = 3,
|
|
54
56
|
use_api_version: int = 1,
|
|
55
57
|
timeout: float = 60.0,
|
|
@@ -72,6 +74,7 @@ class Client:
|
|
|
72
74
|
self.customers = CustomersClient(self)
|
|
73
75
|
self.customer_portal_sessions = CustomerPortalSessionsClient(self)
|
|
74
76
|
self.discounts = DiscountsClient(self)
|
|
77
|
+
self.discount_groups = DiscountGroupsClient(self)
|
|
75
78
|
self.events = EventsClient(self)
|
|
76
79
|
self.event_types = EventTypesClient(self)
|
|
77
80
|
self.notifications = NotificationsClient(self)
|
|
@@ -110,7 +113,7 @@ class Client:
|
|
|
110
113
|
self.log.debug(f"Response: {response.status_code} {response.text}")
|
|
111
114
|
|
|
112
115
|
@staticmethod
|
|
113
|
-
def serialize_json_payload(payload: dict | Operation) -> str:
|
|
116
|
+
def serialize_json_payload(payload: dict[str, Any] | Operation) -> str:
|
|
114
117
|
json_payload = json_dumps(payload, cls=PayloadEncoder)
|
|
115
118
|
final_json = json_payload if json_payload != "[]" else "{}"
|
|
116
119
|
|
|
@@ -120,7 +123,7 @@ class Client:
|
|
|
120
123
|
self,
|
|
121
124
|
method: str,
|
|
122
125
|
url: str,
|
|
123
|
-
payload: dict | Operation | None = None,
|
|
126
|
+
payload: dict[str, Any] | Operation | None = None,
|
|
124
127
|
) -> Response:
|
|
125
128
|
"""
|
|
126
129
|
Makes an actual API call to Paddle
|
|
@@ -157,7 +160,7 @@ class Client:
|
|
|
157
160
|
raise
|
|
158
161
|
|
|
159
162
|
@staticmethod
|
|
160
|
-
def format_uri_parameters(uri: str, parameters: HasParameters | dict) -> str:
|
|
163
|
+
def format_uri_parameters(uri: str, parameters: HasParameters | dict[str, str]) -> str:
|
|
161
164
|
if isinstance(parameters, HasParameters):
|
|
162
165
|
parameters = parameters.get_parameters()
|
|
163
166
|
|
|
@@ -167,19 +170,22 @@ class Client:
|
|
|
167
170
|
|
|
168
171
|
return uri
|
|
169
172
|
|
|
170
|
-
def get_raw(self, url: str, parameters: HasParameters | dict = None) -> Response:
|
|
173
|
+
def get_raw(self, url: str, parameters: HasParameters | dict[str, str] | None = None) -> Response:
|
|
171
174
|
url = Client.format_uri_parameters(url, parameters) if parameters else url
|
|
172
175
|
|
|
173
176
|
return self._make_request("GET", url, None)
|
|
174
177
|
|
|
175
178
|
def post_raw(
|
|
176
|
-
self,
|
|
179
|
+
self,
|
|
180
|
+
url: str,
|
|
181
|
+
payload: dict[str, str] | Operation | None = None,
|
|
182
|
+
parameters: HasParameters | dict[str, str] | None = None,
|
|
177
183
|
) -> Response:
|
|
178
184
|
url = Client.format_uri_parameters(url, parameters) if parameters else url
|
|
179
185
|
|
|
180
186
|
return self._make_request("POST", url, payload)
|
|
181
187
|
|
|
182
|
-
def patch_raw(self, url: str, payload: dict | Operation | None) -> Response:
|
|
188
|
+
def patch_raw(self, url: str, payload: dict[str, str] | Operation | None) -> Response:
|
|
183
189
|
return self._make_request("PATCH", url, payload)
|
|
184
190
|
|
|
185
191
|
def delete_raw(self, url: str) -> Response:
|
|
@@ -192,7 +198,7 @@ class Client:
|
|
|
192
198
|
"Authorization": f"Bearer {self.__api_key}",
|
|
193
199
|
"Content-Type": "application/json",
|
|
194
200
|
"Paddle-Version": str(self.use_api_version),
|
|
195
|
-
"User-Agent": "PaddleSDK/python 1.
|
|
201
|
+
"User-Agent": "PaddleSDK/python 1.7.0",
|
|
196
202
|
}
|
|
197
203
|
)
|
|
198
204
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
4
5
|
|
|
5
6
|
from paddle_billing.Entities.Entity import Entity
|
|
6
7
|
from paddle_billing.Entities.Shared import CountryCode, CustomData, ImportMeta, Status
|
|
@@ -24,7 +25,7 @@ class Address(Entity):
|
|
|
24
25
|
import_meta: ImportMeta | None
|
|
25
26
|
|
|
26
27
|
@staticmethod
|
|
27
|
-
def from_dict(data: dict) -> Address:
|
|
28
|
+
def from_dict(data: dict[str, Any]) -> Address:
|
|
28
29
|
return Address(
|
|
29
30
|
id=data["id"],
|
|
30
31
|
customer_id=data["customer_id"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
4
5
|
|
|
5
6
|
from paddle_billing.Entities.Entity import Entity
|
|
6
7
|
from paddle_billing.Entities.Adjustments import AdjustmentItem, AdjustmentTaxRatesUsed
|
|
@@ -34,7 +35,7 @@ class Adjustment(Entity):
|
|
|
34
35
|
type: AdjustmentActionType
|
|
35
36
|
|
|
36
37
|
@staticmethod
|
|
37
|
-
def from_dict(data: dict) -> Adjustment:
|
|
38
|
+
def from_dict(data: dict[str, Any]) -> Adjustment:
|
|
38
39
|
return Adjustment(
|
|
39
40
|
id=data["id"],
|
|
40
41
|
action=Action(data["action"]),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
5
|
from paddle_billing.Entities.Entity import Entity
|
|
5
6
|
|
|
@@ -9,5 +10,5 @@ class AdjustmentCreditNote(Entity):
|
|
|
9
10
|
url: str
|
|
10
11
|
|
|
11
12
|
@staticmethod
|
|
12
|
-
def from_dict(data: dict) -> AdjustmentCreditNote:
|
|
13
|
+
def from_dict(data: dict[str, Any]) -> AdjustmentCreditNote:
|
|
13
14
|
return AdjustmentCreditNote(data["url"])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
@dataclass
|
|
@@ -9,7 +10,7 @@ class AdjustmentCustomerBalance:
|
|
|
9
10
|
used: str
|
|
10
11
|
|
|
11
12
|
@staticmethod
|
|
12
|
-
def from_dict(data: dict) -> AdjustmentCustomerBalance:
|
|
13
|
+
def from_dict(data: dict[str, Any]) -> AdjustmentCustomerBalance:
|
|
13
14
|
return AdjustmentCustomerBalance(
|
|
14
15
|
available=data["available"],
|
|
15
16
|
reserved=data["reserved"],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
5
|
from paddle_billing.Entities.Shared import AdjustmentItemTotals, AdjustmentType, Proration
|
|
5
6
|
|
|
@@ -14,7 +15,7 @@ class AdjustmentItem:
|
|
|
14
15
|
totals: AdjustmentItemTotals
|
|
15
16
|
|
|
16
17
|
@staticmethod
|
|
17
|
-
def from_dict(data: dict) -> AdjustmentItem:
|
|
18
|
+
def from_dict(data: dict[str, Any]) -> AdjustmentItem:
|
|
18
19
|
return AdjustmentItem(
|
|
19
20
|
id=data["id"],
|
|
20
21
|
item_id=data["item_id"],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
5
|
from paddle_billing.Entities.Adjustments.AdjustmentTotals import AdjustmentTotals
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ class AdjustmentTaxRatesUsed:
|
|
|
10
11
|
totals: AdjustmentTotals
|
|
11
12
|
|
|
12
13
|
@staticmethod
|
|
13
|
-
def from_dict(data: dict) -> AdjustmentTaxRatesUsed:
|
|
14
|
+
def from_dict(data: dict[str, Any]) -> AdjustmentTaxRatesUsed:
|
|
14
15
|
return AdjustmentTaxRatesUsed(
|
|
15
16
|
tax_rate=data["tax_rate"],
|
|
16
17
|
totals=AdjustmentTotals.from_dict(data["totals"]),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
@dataclass
|
|
@@ -9,7 +10,7 @@ class AdjustmentTotals:
|
|
|
9
10
|
total: str
|
|
10
11
|
|
|
11
12
|
@staticmethod
|
|
12
|
-
def from_dict(data: dict) -> AdjustmentTotals:
|
|
13
|
+
def from_dict(data: dict[str, Any]) -> AdjustmentTotals:
|
|
13
14
|
return AdjustmentTotals(
|
|
14
15
|
subtotal=data["subtotal"],
|
|
15
16
|
tax=data["tax"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
4
5
|
|
|
5
6
|
from paddle_billing.Entities.Entity import Entity
|
|
6
7
|
from paddle_billing.Entities.Shared import Contacts, CustomData, ImportMeta, Status
|
|
@@ -21,7 +22,7 @@ class Business(Entity):
|
|
|
21
22
|
import_meta: ImportMeta | None = None
|
|
22
23
|
|
|
23
24
|
@staticmethod
|
|
24
|
-
def from_dict(data: dict) -> Business:
|
|
25
|
+
def from_dict(data: dict[str, Any]) -> Business:
|
|
25
26
|
return Business(
|
|
26
27
|
id=data["id"],
|
|
27
28
|
customer_id=data["customer_id"],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Address import Address
|
|
4
5
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
|
7
8
|
|
|
8
9
|
class AddressCollection(Collection[Address]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> AddressCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> AddressCollection:
|
|
11
12
|
items: list[Address] = [Address.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return AddressCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Adjustment import Adjustment
|
|
4
5
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
|
7
8
|
|
|
8
9
|
class AdjustmentCollection(Collection[Adjustment]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> AdjustmentCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> AdjustmentCollection:
|
|
11
12
|
items: list[Adjustment] = [Adjustment.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return AdjustmentCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Business import Business
|
|
4
5
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
|
7
8
|
|
|
8
9
|
class BusinessCollection(Collection[Business]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> BusinessCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> BusinessCollection:
|
|
11
12
|
|
|
12
13
|
items: list[Business] = [Business.from_dict(item) for item in items_data]
|
|
13
14
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.CreditBalance import CreditBalance
|
|
|
7
8
|
|
|
8
9
|
class CreditBalanceCollection(Collection[CreditBalance]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> CreditBalanceCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> CreditBalanceCollection:
|
|
11
12
|
items: list[CreditBalance] = [CreditBalance.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return CreditBalanceCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Customer import Customer
|
|
|
7
8
|
|
|
8
9
|
class CustomerCollection(Collection[Customer]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> CustomerCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> CustomerCollection:
|
|
11
12
|
items: list[Customer] = [Customer.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return CustomerCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Discount import Discount
|
|
|
7
8
|
|
|
8
9
|
class DiscountCollection(Collection[Discount]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> DiscountCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> DiscountCollection:
|
|
11
12
|
items: list[Discount] = [Discount.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return DiscountCollection(items, paginator)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from paddle_billing.Entities.Collections.Collection import Collection
|
|
5
|
+
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
6
|
+
from paddle_billing.Entities.DiscountGroup import DiscountGroup
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DiscountGroupCollection(Collection[DiscountGroup]):
|
|
10
|
+
@classmethod
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> DiscountGroupCollection:
|
|
12
|
+
items: list[DiscountGroup] = [DiscountGroup.from_dict(item) for item in items_data]
|
|
13
|
+
|
|
14
|
+
return DiscountGroupCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Event import Event
|
|
|
7
8
|
|
|
8
9
|
class EventCollection(Collection[Event]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> EventCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> EventCollection:
|
|
11
12
|
items: list[Event] = [Event.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return EventCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.EventType import EventType
|
|
|
7
8
|
|
|
8
9
|
class EventTypeCollection(Collection[EventType]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> EventTypeCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> EventTypeCollection:
|
|
11
12
|
items: list[EventType] = [EventType.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return EventTypeCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Notification import Notification
|
|
|
7
8
|
|
|
8
9
|
class NotificationCollection(Collection[Notification]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> NotificationCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> NotificationCollection:
|
|
11
12
|
items: list[Notification] = [Notification.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return NotificationCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,9 @@ from paddle_billing.Entities.NotificationLog import NotificationLog
|
|
|
7
8
|
|
|
8
9
|
class NotificationLogCollection(Collection[NotificationLog]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(
|
|
11
|
+
def from_list(
|
|
12
|
+
cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None
|
|
13
|
+
) -> NotificationLogCollection:
|
|
11
14
|
items: list[NotificationLog] = [NotificationLog.from_dict(item) for item in items_data]
|
|
12
15
|
|
|
13
16
|
return NotificationLogCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,9 @@ from paddle_billing.Entities.NotificationSetting import NotificationSetting
|
|
|
7
8
|
|
|
8
9
|
class NotificationSettingCollection(Collection[NotificationSetting]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(
|
|
11
|
+
def from_list(
|
|
12
|
+
cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None
|
|
13
|
+
) -> NotificationSettingCollection:
|
|
11
14
|
items: list[NotificationSetting] = [NotificationSetting.from_dict(item) for item in items_data]
|
|
12
15
|
|
|
13
16
|
return NotificationSettingCollection(items, paginator)
|
|
@@ -18,7 +18,7 @@ class Paginator:
|
|
|
18
18
|
def has_more(self) -> bool:
|
|
19
19
|
return self._pagination.has_more
|
|
20
20
|
|
|
21
|
-
def next_page(self) -> "Collection":
|
|
21
|
+
def next_page(self) -> "Collection": # type: ignore
|
|
22
22
|
response = self._client.get_raw(self._pagination.next)
|
|
23
23
|
response_parser = ResponseParser(response)
|
|
24
24
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.PaymentMethod import PaymentMethod
|
|
|
7
8
|
|
|
8
9
|
class PaymentMethodCollection(Collection[PaymentMethod]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> PaymentMethodCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> PaymentMethodCollection:
|
|
11
12
|
items: list[PaymentMethod] = [PaymentMethod.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return PaymentMethodCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Price import Price
|
|
|
7
8
|
|
|
8
9
|
class PriceCollection(Collection[Price]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> PriceCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> PriceCollection:
|
|
11
12
|
items: list[Price] = [Price.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return PriceCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Product import Product
|
|
|
7
8
|
|
|
8
9
|
class ProductCollection(Collection[Product]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> ProductCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> ProductCollection:
|
|
11
12
|
items: list[Product] = [Product.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return ProductCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Report import Report
|
|
|
7
8
|
|
|
8
9
|
class ReportCollection(Collection[Report]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> ReportCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> ReportCollection:
|
|
11
12
|
items: list[Report] = [Report.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return ReportCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Simulation import Simulation
|
|
|
7
8
|
|
|
8
9
|
class SimulationCollection(Collection[Simulation]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> SimulationCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> SimulationCollection:
|
|
11
12
|
items: list[Simulation] = [Simulation.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return SimulationCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.SimulationRun import SimulationRun
|
|
|
7
8
|
|
|
8
9
|
class SimulationRunCollection(Collection[SimulationRun]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> SimulationRunCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> SimulationRunCollection:
|
|
11
12
|
items: list[SimulationRun] = [SimulationRun.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return SimulationRunCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,9 @@ from paddle_billing.Entities.SimulationRunEvent import SimulationRunEvent
|
|
|
7
8
|
|
|
8
9
|
class SimulationRunEventCollection(Collection[SimulationRunEvent]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(
|
|
11
|
+
def from_list(
|
|
12
|
+
cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None
|
|
13
|
+
) -> SimulationRunEventCollection:
|
|
11
14
|
items: list[SimulationRunEvent] = [SimulationRunEvent.from_dict(item) for item in items_data]
|
|
12
15
|
|
|
13
16
|
return SimulationRunEventCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,9 @@ from paddle_billing.Entities.SimulationType import SimulationType
|
|
|
7
8
|
|
|
8
9
|
class SimulationTypeCollection(Collection[SimulationType]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(
|
|
11
|
+
def from_list(
|
|
12
|
+
cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None
|
|
13
|
+
) -> SimulationTypeCollection:
|
|
11
14
|
items: list[SimulationType] = [SimulationType.from_dict(item) for item in items_data]
|
|
12
15
|
|
|
13
16
|
return SimulationTypeCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Subscription import Subscription
|
|
|
7
8
|
|
|
8
9
|
class SubscriptionCollection(Collection[Subscription]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> SubscriptionCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> SubscriptionCollection:
|
|
11
12
|
items: list[Subscription] = [Subscription.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return SubscriptionCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.SubscriptionPreview import SubscriptionPreview
|
|
|
7
8
|
|
|
8
9
|
class SubscriptionPreviewCollection(Collection[SubscriptionPreview]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> SubscriptionPreviewCollection:
|
|
11
|
+
def from_list(cls, items_data: list[Any], paginator: Paginator | None = None) -> SubscriptionPreviewCollection:
|
|
11
12
|
items: list[SubscriptionPreview] = [SubscriptionPreview.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return SubscriptionPreviewCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,7 @@ from paddle_billing.Entities.Transaction import Transaction
|
|
|
7
8
|
|
|
8
9
|
class TransactionCollection(Collection[Transaction]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(cls, items_data: list, paginator: Paginator | None = None) -> TransactionCollection:
|
|
11
|
+
def from_list(cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None) -> TransactionCollection:
|
|
11
12
|
items: list[Transaction] = [Transaction.from_dict(item) for item in items_data]
|
|
12
13
|
|
|
13
14
|
return TransactionCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,9 @@ from paddle_billing.Entities.TransactionPreview import TransactionPreview
|
|
|
7
8
|
|
|
8
9
|
class TransactionPreviewCollection(Collection[TransactionPreview]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(
|
|
11
|
+
def from_list(
|
|
12
|
+
cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None
|
|
13
|
+
) -> TransactionPreviewCollection:
|
|
11
14
|
items: list[TransactionPreview] = [TransactionPreview.from_dict(item) for item in items_data]
|
|
12
15
|
|
|
13
16
|
return TransactionPreviewCollection(items, paginator)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from paddle_billing.Entities.Collections.Collection import Collection
|
|
4
5
|
from paddle_billing.Entities.Collections.Paginator import Paginator
|
|
@@ -7,7 +8,9 @@ from paddle_billing.Entities.TransactionData import TransactionData
|
|
|
7
8
|
|
|
8
9
|
class TransactionsDataCollection(Collection[TransactionData]):
|
|
9
10
|
@classmethod
|
|
10
|
-
def from_list(
|
|
11
|
+
def from_list(
|
|
12
|
+
cls, items_data: list[dict[str, Any]], paginator: Paginator | None = None
|
|
13
|
+
) -> TransactionsDataCollection:
|
|
11
14
|
items: list[TransactionData] = [TransactionData.from_dict(item) for item in items_data]
|
|
12
15
|
|
|
13
16
|
return TransactionsDataCollection(items, paginator)
|