From 36ab7133adc32436ba8fb79f9f5582cde9ed20e1 Mon Sep 17 00:00:00 2001 From: Michael Woodward Date: Fri, 2 Aug 2024 13:45:50 +0100 Subject: [PATCH 1/2] feat!: Graceful fallback with PaddleStrEnum - Reimplements PaddleStrEnum - Drops native Enum usage - Replicates Enum semantics - Adds a JSON encoder for payloads BREAKING CHANGE: Native enums have been dropped. --- paddle_billing/Client.py | 11 ++- .../Entities/Discounts/DiscountStatus.py | 4 +- .../Entities/Discounts/DiscountType.py | 4 +- .../Entities/Events/EventTypeName.py | 4 +- .../NotificationSettingType.py | 4 +- .../Notifications/NotificationOrigin.py | 4 +- .../Notifications/NotificationPayoutStatus.py | 4 +- .../Notifications/NotificationStatus.py | 4 +- .../Entities/Reports/ReportFilterName.py | 4 +- .../Entities/Reports/ReportFilterOperator.py | 4 +- .../Entities/Reports/ReportStatus.py | 4 +- paddle_billing/Entities/Reports/ReportType.py | 4 +- paddle_billing/Entities/Shared/Action.py | 4 +- .../Entities/Shared/AdjustmentStatus.py | 4 +- .../Entities/Shared/AdjustmentType.py | 4 +- .../Shared/AvailablePaymentMethods.py | 4 +- paddle_billing/Entities/Shared/CatalogType.py | 4 +- .../Entities/Shared/CollectionMode.py | 4 +- paddle_billing/Entities/Shared/CountryCode.py | 4 +- .../Entities/Shared/CurrencyCode.py | 4 +- .../Shared/CurrencyCodeAdjustments.py | 4 +- .../Entities/Shared/CurrencyCodePayouts.py | 4 +- paddle_billing/Entities/Shared/ErrorCode.py | 4 +- paddle_billing/Entities/Shared/Interval.py | 4 +- .../Entities/Shared/PaymentAttemptStatus.py | 4 +- .../Entities/Shared/PaymentMethodType.py | 4 +- paddle_billing/Entities/Shared/Status.py | 4 +- paddle_billing/Entities/Shared/TaxCategory.py | 4 +- paddle_billing/Entities/Shared/TaxMode.py | 4 +- .../Entities/Shared/TransactionOrigin.py | 4 +- .../Entities/Shared/TransactionStatus.py | 4 +- .../SubscriptionEffectiveFrom.py | 4 +- .../Subscriptions/SubscriptionItemStatus.py | 4 +- .../SubscriptionOnPaymentFailure.py | 4 +- .../SubscriptionProrationBillingMode.py | 4 +- .../Subscriptions/SubscriptionResultAction.py | 4 +- .../SubscriptionResumeEffectiveFrom.py | 4 +- .../SubscriptionScheduledChangeAction.py | 4 +- .../Subscriptions/SubscriptionStatus.py | 4 +- .../Transactions/TransactionCardType.py | 4 +- paddle_billing/Environment.py | 8 +- .../Entities/Discounts/DiscountStatus.py | 4 +- .../Entities/Discounts/DiscountType.py | 4 +- .../Entities/Payouts/PayoutStatus.py | 4 +- .../Entities/Reports/ReportFilterName.py | 4 +- .../Entities/Reports/ReportFilterOperator.py | 4 +- .../Entities/Reports/ReportStatus.py | 4 +- .../Entities/Reports/ReportType.py | 4 +- .../Notifications/Entities/Shared/Action.py | 4 +- .../Entities/Shared/AdjustmentStatus.py | 4 +- .../Entities/Shared/AdjustmentType.py | 4 +- .../Shared/AvailablePaymentMethods.py | 4 +- .../Entities/Shared/CatalogType.py | 4 +- .../Entities/Shared/CollectionMode.py | 4 +- .../Entities/Shared/CountryCode.py | 4 +- .../Entities/Shared/CurrencyCode.py | 4 +- .../Shared/CurrencyCodeAdjustments.py | 4 +- .../Entities/Shared/CurrencyCodePayouts.py | 4 +- .../Entities/Shared/ErrorCode.py | 4 +- .../Notifications/Entities/Shared/Interval.py | 4 +- .../Entities/Shared/PaymentAttemptStatus.py | 4 +- .../Entities/Shared/PaymentMethodType.py | 4 +- .../Notifications/Entities/Shared/Status.py | 4 +- .../Entities/Shared/TaxCategory.py | 4 +- .../Notifications/Entities/Shared/TaxMode.py | 4 +- .../Entities/Shared/TransactionOrigin.py | 4 +- .../Entities/Shared/TransactionStatus.py | 4 +- .../SubscriptionEffectiveFrom.py | 4 +- .../Subscriptions/SubscriptionItemStatus.py | 4 +- .../SubscriptionOnPaymentFailure.py | 4 +- .../SubscriptionScheduledChangeAction.py | 4 +- .../Subscriptions/SubscriptionStatus.py | 4 +- .../Transactions/TransactionCardType.py | 4 +- paddle_billing/Options.py | 4 +- paddle_billing/PaddleStrEnum.py | 99 +++++++++++++++---- .../Prices/Operations/List/Includes.py | 4 +- .../Products/Operations/List/Includes.py | 4 +- .../Shared/Operations/List/Comparator.py | 4 +- .../Subscriptions/Operations/Get/Includes.py | 4 +- .../Transactions/Operations/List/Includes.py | 4 +- .../Transactions/Operations/List/Origin.py | 4 +- .../Unit/PaddleStrEnum/test_PaddleStrEnum.py | 59 +++++++---- 82 files changed, 287 insertions(+), 202 deletions(-) diff --git a/paddle_billing/Client.py b/paddle_billing/Client.py index a9073df1..8160762b 100644 --- a/paddle_billing/Client.py +++ b/paddle_billing/Client.py @@ -1,4 +1,4 @@ -from json import dumps as json_dumps +from json import dumps as json_dumps, JSONEncoder from logging import Logger, getLogger from requests import Response, RequestException, Session from requests.adapters import HTTPAdapter @@ -9,6 +9,7 @@ from paddle_billing.FiltersUndefined import FiltersUndefined from paddle_billing.HasParameters import HasParameters from paddle_billing.Options import Options +from paddle_billing.PaddleStrEnum import PaddleStrEnum from paddle_billing.ResponseParser import ResponseParser from paddle_billing.Logger.NullHandler import NullHandler @@ -30,6 +31,12 @@ from paddle_billing.Resources.Subscriptions.SubscriptionsClient import SubscriptionsClient from paddle_billing.Resources.Transactions.TransactionsClient import TransactionsClient +class PayloadEncoder(JSONEncoder): + def default(self, z): + if hasattr(z, 'to_json') and callable(z.to_json): + return z.to_json() + + return super().default(z) class Client: """ @@ -100,7 +107,7 @@ def serialize_json_payload(payload: dict) -> str: if payload.get('custom_data') and 'data' in payload['custom_data']: payload['custom_data'] = payload['custom_data']['data'] - json_payload = json_dumps(payload) + json_payload = json_dumps(payload, cls=PayloadEncoder) final_json = json_payload if json_payload != '[]' else '{}' return final_json diff --git a/paddle_billing/Entities/Discounts/DiscountStatus.py b/paddle_billing/Entities/Discounts/DiscountStatus.py index 110b3774..8e866505 100644 --- a/paddle_billing/Entities/Discounts/DiscountStatus.py +++ b/paddle_billing/Entities/Discounts/DiscountStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class DiscountStatus(PaddleStrEnum): +class DiscountStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Archived = 'archived' Expired = 'expired' diff --git a/paddle_billing/Entities/Discounts/DiscountType.py b/paddle_billing/Entities/Discounts/DiscountType.py index e257f38e..7c43e9a0 100644 --- a/paddle_billing/Entities/Discounts/DiscountType.py +++ b/paddle_billing/Entities/Discounts/DiscountType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class DiscountType(PaddleStrEnum): +class DiscountType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Flat = 'flat' FlatPerSeat = 'flat_per_seat' Percentage = 'percentage' diff --git a/paddle_billing/Entities/Events/EventTypeName.py b/paddle_billing/Entities/Events/EventTypeName.py index 8eddc88e..5594dd7e 100644 --- a/paddle_billing/Entities/Events/EventTypeName.py +++ b/paddle_billing/Entities/Events/EventTypeName.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class EventTypeName(PaddleStrEnum): +class EventTypeName(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AddressCreated = 'address.created' AddressImported = 'address.imported' AddressUpdated = 'address.updated' diff --git a/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py b/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py index c15d8665..b9f444d4 100644 --- a/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py +++ b/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class NotificationSettingType(PaddleStrEnum): +class NotificationSettingType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Email = 'email' Url = 'url' diff --git a/paddle_billing/Entities/Notifications/NotificationOrigin.py b/paddle_billing/Entities/Notifications/NotificationOrigin.py index 8d4396a5..253aa00d 100644 --- a/paddle_billing/Entities/Notifications/NotificationOrigin.py +++ b/paddle_billing/Entities/Notifications/NotificationOrigin.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class NotificationOrigin(PaddleStrEnum): +class NotificationOrigin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Event = 'event' Replay = 'replay' diff --git a/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py b/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py index 8a921783..4f5dd2a6 100644 --- a/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py +++ b/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class NotificationPayoutStatus(PaddleStrEnum): +class NotificationPayoutStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Unpaid = 'unpaid' Paid = 'paid' diff --git a/paddle_billing/Entities/Notifications/NotificationStatus.py b/paddle_billing/Entities/Notifications/NotificationStatus.py index f438f550..285156c0 100644 --- a/paddle_billing/Entities/Notifications/NotificationStatus.py +++ b/paddle_billing/Entities/Notifications/NotificationStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class NotificationStatus(PaddleStrEnum): +class NotificationStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): NotAttempted = 'not_attempted' NeedsRetry = 'needs_retry' Delivered = 'delivered' diff --git a/paddle_billing/Entities/Reports/ReportFilterName.py b/paddle_billing/Entities/Reports/ReportFilterName.py index 9d8df22b..c0d89d0c 100644 --- a/paddle_billing/Entities/Reports/ReportFilterName.py +++ b/paddle_billing/Entities/Reports/ReportFilterName.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportFilterName(PaddleStrEnum): +class ReportFilterName(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Action = 'action' CollectionMode = 'collection_mode' CurrencyCode = 'currency_code' diff --git a/paddle_billing/Entities/Reports/ReportFilterOperator.py b/paddle_billing/Entities/Reports/ReportFilterOperator.py index 829b5d5f..16974c4b 100644 --- a/paddle_billing/Entities/Reports/ReportFilterOperator.py +++ b/paddle_billing/Entities/Reports/ReportFilterOperator.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportFilterOperator(PaddleStrEnum): +class ReportFilterOperator(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Lt = 'lt' Gte = 'gte' diff --git a/paddle_billing/Entities/Reports/ReportStatus.py b/paddle_billing/Entities/Reports/ReportStatus.py index 60640919..1af7955f 100644 --- a/paddle_billing/Entities/Reports/ReportStatus.py +++ b/paddle_billing/Entities/Reports/ReportStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportStatus(PaddleStrEnum): +class ReportStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Pending = 'pending' Ready = 'ready' Failed = 'failed' diff --git a/paddle_billing/Entities/Reports/ReportType.py b/paddle_billing/Entities/Reports/ReportType.py index b5758907..922769a3 100644 --- a/paddle_billing/Entities/Reports/ReportType.py +++ b/paddle_billing/Entities/Reports/ReportType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportType(PaddleStrEnum): +class ReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Adjustments = 'adjustments' AdjustmentLineItems = 'adjustment_line_items' Discounts = 'discounts' diff --git a/paddle_billing/Entities/Shared/Action.py b/paddle_billing/Entities/Shared/Action.py index d502529d..d512be63 100644 --- a/paddle_billing/Entities/Shared/Action.py +++ b/paddle_billing/Entities/Shared/Action.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Action(PaddleStrEnum): +class Action(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Credit = 'credit' CreditReverse = 'credit_reverse' Refund = 'refund' diff --git a/paddle_billing/Entities/Shared/AdjustmentStatus.py b/paddle_billing/Entities/Shared/AdjustmentStatus.py index 0d0868c7..0115c6e5 100644 --- a/paddle_billing/Entities/Shared/AdjustmentStatus.py +++ b/paddle_billing/Entities/Shared/AdjustmentStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class AdjustmentStatus(PaddleStrEnum): +class AdjustmentStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): PendingApproval = 'pending_approval' Approved = 'approved' Rejected = 'rejected' diff --git a/paddle_billing/Entities/Shared/AdjustmentType.py b/paddle_billing/Entities/Shared/AdjustmentType.py index a8f7d5b2..8d4cc7ad 100644 --- a/paddle_billing/Entities/Shared/AdjustmentType.py +++ b/paddle_billing/Entities/Shared/AdjustmentType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class AdjustmentType(PaddleStrEnum): +class AdjustmentType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Full = 'full' Partial = 'partial' Tax = 'tax' diff --git a/paddle_billing/Entities/Shared/AvailablePaymentMethods.py b/paddle_billing/Entities/Shared/AvailablePaymentMethods.py index 965d548a..5c7457a4 100644 --- a/paddle_billing/Entities/Shared/AvailablePaymentMethods.py +++ b/paddle_billing/Entities/Shared/AvailablePaymentMethods.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class AvailablePaymentMethods(PaddleStrEnum): +class AvailablePaymentMethods(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Alipay = 'alipay' ApplePay = 'apple_pay' Bancontact = 'bancontact' diff --git a/paddle_billing/Entities/Shared/CatalogType.py b/paddle_billing/Entities/Shared/CatalogType.py index 57171d58..0dfa728d 100644 --- a/paddle_billing/Entities/Shared/CatalogType.py +++ b/paddle_billing/Entities/Shared/CatalogType.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CatalogType(PaddleStrEnum): +class CatalogType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Standard = 'standard' Custom = 'custom' diff --git a/paddle_billing/Entities/Shared/CollectionMode.py b/paddle_billing/Entities/Shared/CollectionMode.py index dbdc3fdd..924a4657 100644 --- a/paddle_billing/Entities/Shared/CollectionMode.py +++ b/paddle_billing/Entities/Shared/CollectionMode.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CollectionMode(PaddleStrEnum): +class CollectionMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Automatic = 'automatic' Manual = 'manual' diff --git a/paddle_billing/Entities/Shared/CountryCode.py b/paddle_billing/Entities/Shared/CountryCode.py index f65ea9a9..7f513bfe 100644 --- a/paddle_billing/Entities/Shared/CountryCode.py +++ b/paddle_billing/Entities/Shared/CountryCode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CountryCode(PaddleStrEnum): +class CountryCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AD = 'AD' AE = 'AE' AG = 'AG' diff --git a/paddle_billing/Entities/Shared/CurrencyCode.py b/paddle_billing/Entities/Shared/CurrencyCode.py index 4a47e960..ea31b0e5 100644 --- a/paddle_billing/Entities/Shared/CurrencyCode.py +++ b/paddle_billing/Entities/Shared/CurrencyCode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CurrencyCode(PaddleStrEnum): +class CurrencyCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): USD = 'USD' EUR = 'EUR' GBP = 'GBP' diff --git a/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py b/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py index 9b214b75..c57e11c9 100644 --- a/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py +++ b/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CurrencyCodeAdjustments(PaddleStrEnum): +class CurrencyCodeAdjustments(PaddleStrEnum, metaclass=PaddleStrEnumMeta): EUR = 'EUR' GBP = 'GBP' USD = 'USD' diff --git a/paddle_billing/Entities/Shared/CurrencyCodePayouts.py b/paddle_billing/Entities/Shared/CurrencyCodePayouts.py index 688935f1..27787954 100644 --- a/paddle_billing/Entities/Shared/CurrencyCodePayouts.py +++ b/paddle_billing/Entities/Shared/CurrencyCodePayouts.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CurrencyCodePayouts(PaddleStrEnum): +class CurrencyCodePayouts(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AUD = 'AUD' CAD = 'CAD' CHF = 'CHF' diff --git a/paddle_billing/Entities/Shared/ErrorCode.py b/paddle_billing/Entities/Shared/ErrorCode.py index d77effeb..bf4256df 100644 --- a/paddle_billing/Entities/Shared/ErrorCode.py +++ b/paddle_billing/Entities/Shared/ErrorCode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ErrorCode(PaddleStrEnum): +class ErrorCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AlreadyCanceled = 'already_canceled' AlreadyRefunded = 'already_refunded' AuthenticationFailed = 'authentication_failed' diff --git a/paddle_billing/Entities/Shared/Interval.py b/paddle_billing/Entities/Shared/Interval.py index 5c82cf61..3648ea26 100644 --- a/paddle_billing/Entities/Shared/Interval.py +++ b/paddle_billing/Entities/Shared/Interval.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Interval(PaddleStrEnum): +class Interval(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Day = 'day' Week = 'week' Month = 'month' diff --git a/paddle_billing/Entities/Shared/PaymentAttemptStatus.py b/paddle_billing/Entities/Shared/PaymentAttemptStatus.py index e2fd66e5..6c296b08 100644 --- a/paddle_billing/Entities/Shared/PaymentAttemptStatus.py +++ b/paddle_billing/Entities/Shared/PaymentAttemptStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class PaymentAttemptStatus(PaddleStrEnum): +class PaymentAttemptStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Authorized = 'authorized' AuthorizedFlagged = 'authorized_flagged' Canceled = 'canceled' diff --git a/paddle_billing/Entities/Shared/PaymentMethodType.py b/paddle_billing/Entities/Shared/PaymentMethodType.py index 6ea60b39..8a935360 100644 --- a/paddle_billing/Entities/Shared/PaymentMethodType.py +++ b/paddle_billing/Entities/Shared/PaymentMethodType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class PaymentMethodType(PaddleStrEnum): +class PaymentMethodType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Alipay = 'alipay' ApplePay = 'apple_pay' Bancontact = 'bancontact' diff --git a/paddle_billing/Entities/Shared/Status.py b/paddle_billing/Entities/Shared/Status.py index 732622d3..e86eef94 100644 --- a/paddle_billing/Entities/Shared/Status.py +++ b/paddle_billing/Entities/Shared/Status.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Status(PaddleStrEnum): +class Status(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Archived = 'archived' diff --git a/paddle_billing/Entities/Shared/TaxCategory.py b/paddle_billing/Entities/Shared/TaxCategory.py index 1c90c8f0..d350d9f7 100644 --- a/paddle_billing/Entities/Shared/TaxCategory.py +++ b/paddle_billing/Entities/Shared/TaxCategory.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TaxCategory(PaddleStrEnum): +class TaxCategory(PaddleStrEnum, metaclass=PaddleStrEnumMeta): DigitalGoods = 'digital-goods' Ebooks = 'ebooks' ImplementationServices = 'implementation-services' diff --git a/paddle_billing/Entities/Shared/TaxMode.py b/paddle_billing/Entities/Shared/TaxMode.py index e0605c2c..0624829c 100644 --- a/paddle_billing/Entities/Shared/TaxMode.py +++ b/paddle_billing/Entities/Shared/TaxMode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TaxMode(PaddleStrEnum): +class TaxMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AccountSetting = 'account_setting' External = 'external' Internal = 'internal' diff --git a/paddle_billing/Entities/Shared/TransactionOrigin.py b/paddle_billing/Entities/Shared/TransactionOrigin.py index 3026283a..70e58776 100644 --- a/paddle_billing/Entities/Shared/TransactionOrigin.py +++ b/paddle_billing/Entities/Shared/TransactionOrigin.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TransactionOrigin(PaddleStrEnum): +class TransactionOrigin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Api = 'api' SubscriptionCharge = 'subscription_charge' SubscriptionPaymentMethodChange = 'subscription_payment_method_change' diff --git a/paddle_billing/Entities/Shared/TransactionStatus.py b/paddle_billing/Entities/Shared/TransactionStatus.py index e8209391..8fd24e74 100644 --- a/paddle_billing/Entities/Shared/TransactionStatus.py +++ b/paddle_billing/Entities/Shared/TransactionStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TransactionStatus(PaddleStrEnum): +class TransactionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Draft = 'draft' Ready = 'ready' Billed = 'billed' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py b/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py index 7d8a2441..14d074dc 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionEffectiveFrom(PaddleStrEnum): +class SubscriptionEffectiveFrom(PaddleStrEnum, metaclass=PaddleStrEnumMeta): NextBillingPeriod = 'next_billing_period' Immediately = 'immediately' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py b/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py index d2b36d5c..e84167c6 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionItemStatus(PaddleStrEnum): +class SubscriptionItemStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Inactive = 'inactive' Trialing = 'trialing' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py b/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py index 75260adf..fce66853 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionOnPaymentFailure(PaddleStrEnum): +class SubscriptionOnPaymentFailure(PaddleStrEnum, metaclass=PaddleStrEnumMeta): PreventChange = 'prevent_change' ApplyChange = 'apply_change' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py b/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py index 839b94f6..2388677a 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionProrationBillingMode(PaddleStrEnum): +class SubscriptionProrationBillingMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): ProratedImmediately = 'prorated_immediately' ProratedNextBillingPeriod = 'prorated_next_billing_period' FullImmediately = 'full_immediately' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py b/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py index 9334e02f..a234b0be 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionResultAction(PaddleStrEnum): +class SubscriptionResultAction(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Credit = 'credit' Charge = 'charge' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py b/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py index a8826329..7c4ac109 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py @@ -1,5 +1,5 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionResumeEffectiveFrom(PaddleStrEnum): +class SubscriptionResumeEffectiveFrom(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Immediately = 'immediately' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py b/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py index b24d8150..0617ebaf 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionScheduledChangeAction(PaddleStrEnum): +class SubscriptionScheduledChangeAction(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Cancel = 'cancel' Pause = 'pause' Resume = 'resume' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py b/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py index 929566fe..8da54014 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionStatus(PaddleStrEnum): +class SubscriptionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Canceled = 'canceled' PastDue = 'past_due' diff --git a/paddle_billing/Entities/Transactions/TransactionCardType.py b/paddle_billing/Entities/Transactions/TransactionCardType.py index fce08e45..99cb0294 100644 --- a/paddle_billing/Entities/Transactions/TransactionCardType.py +++ b/paddle_billing/Entities/Transactions/TransactionCardType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TransactionCardType(PaddleStrEnum): +class TransactionCardType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AmericanExpress = 'american_express' DinersClub = 'diners_club' Discover = 'discover' diff --git a/paddle_billing/Environment.py b/paddle_billing/Environment.py index a4d523af..faf4d28f 100644 --- a/paddle_billing/Environment.py +++ b/paddle_billing/Environment.py @@ -1,9 +1,9 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Environment(PaddleStrEnum): - PRODUCTION = 'production' - SANDBOX = 'sandbox' +class Environment(PaddleStrEnum, metaclass=PaddleStrEnumMeta): + PRODUCTION: "Environment" = 'production' + SANDBOX: "Environment" = 'sandbox' @property diff --git a/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py b/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py index 110b3774..8e866505 100644 --- a/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py +++ b/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class DiscountStatus(PaddleStrEnum): +class DiscountStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Archived = 'archived' Expired = 'expired' diff --git a/paddle_billing/Notifications/Entities/Discounts/DiscountType.py b/paddle_billing/Notifications/Entities/Discounts/DiscountType.py index e257f38e..7c43e9a0 100644 --- a/paddle_billing/Notifications/Entities/Discounts/DiscountType.py +++ b/paddle_billing/Notifications/Entities/Discounts/DiscountType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class DiscountType(PaddleStrEnum): +class DiscountType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Flat = 'flat' FlatPerSeat = 'flat_per_seat' Percentage = 'percentage' diff --git a/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py b/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py index 42630cbf..ec03d07c 100644 --- a/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py +++ b/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class PayoutStatus(PaddleStrEnum): +class PayoutStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Unpaid = 'unpaid' Paid = 'paid' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py b/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py index 9d8df22b..c0d89d0c 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportFilterName(PaddleStrEnum): +class ReportFilterName(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Action = 'action' CollectionMode = 'collection_mode' CurrencyCode = 'currency_code' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py b/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py index 829b5d5f..16974c4b 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportFilterOperator(PaddleStrEnum): +class ReportFilterOperator(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Lt = 'lt' Gte = 'gte' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportStatus.py b/paddle_billing/Notifications/Entities/Reports/ReportStatus.py index 60640919..1af7955f 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportStatus.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportStatus(PaddleStrEnum): +class ReportStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Pending = 'pending' Ready = 'ready' Failed = 'failed' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportType.py b/paddle_billing/Notifications/Entities/Reports/ReportType.py index b5758907..922769a3 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportType.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ReportType(PaddleStrEnum): +class ReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Adjustments = 'adjustments' AdjustmentLineItems = 'adjustment_line_items' Discounts = 'discounts' diff --git a/paddle_billing/Notifications/Entities/Shared/Action.py b/paddle_billing/Notifications/Entities/Shared/Action.py index d502529d..d512be63 100644 --- a/paddle_billing/Notifications/Entities/Shared/Action.py +++ b/paddle_billing/Notifications/Entities/Shared/Action.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Action(PaddleStrEnum): +class Action(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Credit = 'credit' CreditReverse = 'credit_reverse' Refund = 'refund' diff --git a/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py b/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py index 0d0868c7..0115c6e5 100644 --- a/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py +++ b/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class AdjustmentStatus(PaddleStrEnum): +class AdjustmentStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): PendingApproval = 'pending_approval' Approved = 'approved' Rejected = 'rejected' diff --git a/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py b/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py index a8f7d5b2..8d4cc7ad 100644 --- a/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py +++ b/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class AdjustmentType(PaddleStrEnum): +class AdjustmentType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Full = 'full' Partial = 'partial' Tax = 'tax' diff --git a/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py b/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py index 965d548a..5c7457a4 100644 --- a/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py +++ b/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class AvailablePaymentMethods(PaddleStrEnum): +class AvailablePaymentMethods(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Alipay = 'alipay' ApplePay = 'apple_pay' Bancontact = 'bancontact' diff --git a/paddle_billing/Notifications/Entities/Shared/CatalogType.py b/paddle_billing/Notifications/Entities/Shared/CatalogType.py index 57171d58..0dfa728d 100644 --- a/paddle_billing/Notifications/Entities/Shared/CatalogType.py +++ b/paddle_billing/Notifications/Entities/Shared/CatalogType.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CatalogType(PaddleStrEnum): +class CatalogType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Standard = 'standard' Custom = 'custom' diff --git a/paddle_billing/Notifications/Entities/Shared/CollectionMode.py b/paddle_billing/Notifications/Entities/Shared/CollectionMode.py index dbdc3fdd..924a4657 100644 --- a/paddle_billing/Notifications/Entities/Shared/CollectionMode.py +++ b/paddle_billing/Notifications/Entities/Shared/CollectionMode.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CollectionMode(PaddleStrEnum): +class CollectionMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Automatic = 'automatic' Manual = 'manual' diff --git a/paddle_billing/Notifications/Entities/Shared/CountryCode.py b/paddle_billing/Notifications/Entities/Shared/CountryCode.py index f65ea9a9..7f513bfe 100644 --- a/paddle_billing/Notifications/Entities/Shared/CountryCode.py +++ b/paddle_billing/Notifications/Entities/Shared/CountryCode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CountryCode(PaddleStrEnum): +class CountryCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AD = 'AD' AE = 'AE' AG = 'AG' diff --git a/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py b/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py index 4a47e960..ea31b0e5 100644 --- a/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py +++ b/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CurrencyCode(PaddleStrEnum): +class CurrencyCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): USD = 'USD' EUR = 'EUR' GBP = 'GBP' diff --git a/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py b/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py index 9b214b75..c57e11c9 100644 --- a/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py +++ b/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CurrencyCodeAdjustments(PaddleStrEnum): +class CurrencyCodeAdjustments(PaddleStrEnum, metaclass=PaddleStrEnumMeta): EUR = 'EUR' GBP = 'GBP' USD = 'USD' diff --git a/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py b/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py index 688935f1..27787954 100644 --- a/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py +++ b/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class CurrencyCodePayouts(PaddleStrEnum): +class CurrencyCodePayouts(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AUD = 'AUD' CAD = 'CAD' CHF = 'CHF' diff --git a/paddle_billing/Notifications/Entities/Shared/ErrorCode.py b/paddle_billing/Notifications/Entities/Shared/ErrorCode.py index d77effeb..bf4256df 100644 --- a/paddle_billing/Notifications/Entities/Shared/ErrorCode.py +++ b/paddle_billing/Notifications/Entities/Shared/ErrorCode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class ErrorCode(PaddleStrEnum): +class ErrorCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AlreadyCanceled = 'already_canceled' AlreadyRefunded = 'already_refunded' AuthenticationFailed = 'authentication_failed' diff --git a/paddle_billing/Notifications/Entities/Shared/Interval.py b/paddle_billing/Notifications/Entities/Shared/Interval.py index 5c82cf61..3648ea26 100644 --- a/paddle_billing/Notifications/Entities/Shared/Interval.py +++ b/paddle_billing/Notifications/Entities/Shared/Interval.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Interval(PaddleStrEnum): +class Interval(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Day = 'day' Week = 'week' Month = 'month' diff --git a/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py b/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py index e2fd66e5..6c296b08 100644 --- a/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py +++ b/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class PaymentAttemptStatus(PaddleStrEnum): +class PaymentAttemptStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Authorized = 'authorized' AuthorizedFlagged = 'authorized_flagged' Canceled = 'canceled' diff --git a/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py b/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py index 6ad172dc..c6b5b4eb 100644 --- a/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py +++ b/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class PaymentMethodType(PaddleStrEnum): +class PaymentMethodType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Alipay = 'alipay' ApplePay = 'apple_pay' Bancontact = 'bancontact' diff --git a/paddle_billing/Notifications/Entities/Shared/Status.py b/paddle_billing/Notifications/Entities/Shared/Status.py index 732622d3..e86eef94 100644 --- a/paddle_billing/Notifications/Entities/Shared/Status.py +++ b/paddle_billing/Notifications/Entities/Shared/Status.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Status(PaddleStrEnum): +class Status(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Archived = 'archived' diff --git a/paddle_billing/Notifications/Entities/Shared/TaxCategory.py b/paddle_billing/Notifications/Entities/Shared/TaxCategory.py index 1c90c8f0..d350d9f7 100644 --- a/paddle_billing/Notifications/Entities/Shared/TaxCategory.py +++ b/paddle_billing/Notifications/Entities/Shared/TaxCategory.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TaxCategory(PaddleStrEnum): +class TaxCategory(PaddleStrEnum, metaclass=PaddleStrEnumMeta): DigitalGoods = 'digital-goods' Ebooks = 'ebooks' ImplementationServices = 'implementation-services' diff --git a/paddle_billing/Notifications/Entities/Shared/TaxMode.py b/paddle_billing/Notifications/Entities/Shared/TaxMode.py index e0605c2c..0624829c 100644 --- a/paddle_billing/Notifications/Entities/Shared/TaxMode.py +++ b/paddle_billing/Notifications/Entities/Shared/TaxMode.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TaxMode(PaddleStrEnum): +class TaxMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AccountSetting = 'account_setting' External = 'external' Internal = 'internal' diff --git a/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py b/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py index 3026283a..70e58776 100644 --- a/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py +++ b/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TransactionOrigin(PaddleStrEnum): +class TransactionOrigin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Api = 'api' SubscriptionCharge = 'subscription_charge' SubscriptionPaymentMethodChange = 'subscription_payment_method_change' diff --git a/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py b/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py index e8209391..8fd24e74 100644 --- a/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py +++ b/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TransactionStatus(PaddleStrEnum): +class TransactionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Draft = 'draft' Ready = 'ready' Billed = 'billed' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py index 7d8a2441..14d074dc 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionEffectiveFrom(PaddleStrEnum): +class SubscriptionEffectiveFrom(PaddleStrEnum, metaclass=PaddleStrEnumMeta): NextBillingPeriod = 'next_billing_period' Immediately = 'immediately' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py index d2b36d5c..e84167c6 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionItemStatus(PaddleStrEnum): +class SubscriptionItemStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Inactive = 'inactive' Trialing = 'trialing' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py index 75260adf..fce66853 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionOnPaymentFailure(PaddleStrEnum): +class SubscriptionOnPaymentFailure(PaddleStrEnum, metaclass=PaddleStrEnumMeta): PreventChange = 'prevent_change' ApplyChange = 'apply_change' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py index b24d8150..0617ebaf 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionScheduledChangeAction(PaddleStrEnum): +class SubscriptionScheduledChangeAction(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Cancel = 'cancel' Pause = 'pause' Resume = 'resume' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py index 929566fe..8da54014 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class SubscriptionStatus(PaddleStrEnum): +class SubscriptionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Active = 'active' Canceled = 'canceled' PastDue = 'past_due' diff --git a/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py b/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py index fce08e45..99cb0294 100644 --- a/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py +++ b/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class TransactionCardType(PaddleStrEnum): +class TransactionCardType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): AmericanExpress = 'american_express' DinersClub = 'diners_club' Discover = 'discover' diff --git a/paddle_billing/Options.py b/paddle_billing/Options.py index 2e04b2f0..ace7f2b5 100644 --- a/paddle_billing/Options.py +++ b/paddle_billing/Options.py @@ -1,10 +1,10 @@ from __future__ import annotations -from dataclasses import dataclass +from dataclasses import dataclass, field from paddle_billing.Environment import Environment @dataclass class Options: - environment: Environment = Environment.PRODUCTION + environment: Environment = field(default_factory=lambda: Environment.PRODUCTION) retries: int = 1 diff --git a/paddle_billing/PaddleStrEnum.py b/paddle_billing/PaddleStrEnum.py index a78e8aa0..e6b6e147 100644 --- a/paddle_billing/PaddleStrEnum.py +++ b/paddle_billing/PaddleStrEnum.py @@ -1,9 +1,3 @@ -from enum import EnumMeta, StrEnum - -from paddle_billing.Undefined import Undefined - - -# Copied from enum.py because IDE complains when calling protected class super()._is_dunder def _is_dunder(name): """ Returns True if a __dunder__ name, False otherwise. @@ -16,29 +10,94 @@ def _is_dunder(name): ) +class PaddleStrEnumMeta(type): + def __new__( + cls, + name, + bases, + attrs + ): + # Store the original attrs to ensure we have all the class attributes + original_attrs = dict(attrs) -class PaddleStrEnumMeta(EnumMeta): - """ - Returns Undefined() by default when a property doesn't exist - This provides some flexibility for the SDK to handle Paddle adding new properties to their APIspec - """ + # Create the new class with the original attributes + new_class = super().__new__(cls, name, bases, attrs) + + # Create instances for all enum members + for key, value in original_attrs.items(): + if _is_dunder(key) or not isinstance(value, str): + continue + # Set enum member as instance of the class + setattr(new_class, key, new_class(value)) + + return new_class def __getattr__(cls, name): if _is_dunder(name): raise AttributeError(name) + return cls(str(name).lower()) + + +class PaddleStrEnum: + value = None + name = None + + _members = None + _iter_index = 0 + + _unknown_name = 'Undefined' + + def __init__(self, value) -> None: + members = self.members() try: - return super().__getattr__(name) - except AttributeError: - return Undefined() + search = list(members.values()).index(value) + self.value = value + self.name = list(members.keys())[search] + except ValueError: + self.value = value + self.name = self._unknown_name + def __iter__(self) -> "PaddleStrEnum": + self._iter_index = 0 + return self + def __next__(self) -> tuple: + members = self.members() -class PaddleStrEnum(StrEnum, metaclass=PaddleStrEnumMeta): - """ - Subclass of StrEnum but uses PaddleStrEnumMeta metaclass to set Undefined() value to undefined enum keys - """ + if self._iter_index >= len(members): + raise StopIteration + + const_name = list(members.keys())[self._iter_index] + const_value = members[const_name] + self._iter_index += 1 + + return const_name, const_value + + def __repr__(self) -> str: + return f"<{self.__class__.__name__}.{self.name}: {self.value}>" + + def __str__(self) -> str: + return self.value + + def __eq__(self, other) -> bool: + if isinstance(other, str): + return self.value == other + + if isinstance(other, PaddleStrEnum): + return self.value == other.value and self.name == other.name + + return False @classmethod - def is_known(cls) -> bool: - """Not yet implemented""" + def members(cls) -> dict: + if not cls._members: + members = dict(filter(lambda item: not item[0].startswith('__'), cls.__dict__.items())) + cls._members = dict(zip(members.keys(), members.values())) + return cls._members + + def is_known(self): + return not self.name == self._unknown_name + + def to_json(self): + return str(self) diff --git a/paddle_billing/Resources/Prices/Operations/List/Includes.py b/paddle_billing/Resources/Prices/Operations/List/Includes.py index c12ea584..47a8550f 100644 --- a/paddle_billing/Resources/Prices/Operations/List/Includes.py +++ b/paddle_billing/Resources/Prices/Operations/List/Includes.py @@ -1,5 +1,5 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Includes(PaddleStrEnum): +class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Product = 'product' diff --git a/paddle_billing/Resources/Products/Operations/List/Includes.py b/paddle_billing/Resources/Products/Operations/List/Includes.py index f291b6f4..d99d5bf7 100644 --- a/paddle_billing/Resources/Products/Operations/List/Includes.py +++ b/paddle_billing/Resources/Products/Operations/List/Includes.py @@ -1,5 +1,5 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Includes(PaddleStrEnum): +class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Prices = 'prices' diff --git a/paddle_billing/Resources/Shared/Operations/List/Comparator.py b/paddle_billing/Resources/Shared/Operations/List/Comparator.py index a698f5db..ef6de16f 100644 --- a/paddle_billing/Resources/Shared/Operations/List/Comparator.py +++ b/paddle_billing/Resources/Shared/Operations/List/Comparator.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Comparator(PaddleStrEnum): +class Comparator(PaddleStrEnum, metaclass=PaddleStrEnumMeta): LT = 'LT' LTE = 'LTE' GT = 'GT' diff --git a/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py b/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py index 22626804..5ced758b 100644 --- a/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py +++ b/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py @@ -1,6 +1,6 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Includes(PaddleStrEnum): +class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): NextTransaction = 'next_transaction' RecurringTransactionDetails = 'recurring_transaction_details' diff --git a/paddle_billing/Resources/Transactions/Operations/List/Includes.py b/paddle_billing/Resources/Transactions/Operations/List/Includes.py index a78ef2c0..88e6e45f 100644 --- a/paddle_billing/Resources/Transactions/Operations/List/Includes.py +++ b/paddle_billing/Resources/Transactions/Operations/List/Includes.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Includes(PaddleStrEnum): +class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Address = 'address' Adjustment = 'adjustment' AdjustmentsTotals = 'adjustments_totals' diff --git a/paddle_billing/Resources/Transactions/Operations/List/Origin.py b/paddle_billing/Resources/Transactions/Operations/List/Origin.py index 4a6f0de0..29e72f19 100644 --- a/paddle_billing/Resources/Transactions/Operations/List/Origin.py +++ b/paddle_billing/Resources/Transactions/Operations/List/Origin.py @@ -1,7 +1,7 @@ -from paddle_billing.PaddleStrEnum import PaddleStrEnum +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta -class Origin(PaddleStrEnum): +class Origin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): Api = 'api' SubscriptionCharge = 'subscription_charge' SubscriptionPaymentMethodChange = 'subscription_payment_method_change' diff --git a/tests/Unit/PaddleStrEnum/test_PaddleStrEnum.py b/tests/Unit/PaddleStrEnum/test_PaddleStrEnum.py index 91077f9e..dc3e4335 100644 --- a/tests/Unit/PaddleStrEnum/test_PaddleStrEnum.py +++ b/tests/Unit/PaddleStrEnum/test_PaddleStrEnum.py @@ -1,37 +1,33 @@ from dataclasses import asdict, dataclass, is_dataclass -from paddle_billing.PaddleStrEnum import PaddleStrEnum -from paddle_billing.Undefined import Undefined - +from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta def test_paddle_str_enum_works_as_expected(): - class TestCountryCodesEnum(PaddleStrEnum): - CA = 'canada' - US = 'usa' - - - assert isinstance(TestCountryCodesEnum.CA, PaddleStrEnum) - assert isinstance(TestCountryCodesEnum.US, PaddleStrEnum) + class TestCountryCodesEnum(PaddleStrEnum, metaclass=PaddleStrEnumMeta): + CA: "TestCountryCodesEnum" = 'canada' + US: "TestCountryCodesEnum" = 'usa' + + assert isinstance(TestCountryCodesEnum.CA, TestCountryCodesEnum) + assert isinstance(TestCountryCodesEnum.US, TestCountryCodesEnum) + assert isinstance(TestCountryCodesEnum('canada'), TestCountryCodesEnum) + assert isinstance(TestCountryCodesEnum('usa'), TestCountryCodesEnum) assert TestCountryCodesEnum.CA == 'canada' assert TestCountryCodesEnum.US == 'usa' assert TestCountryCodesEnum('canada') == 'canada' assert TestCountryCodesEnum('usa') == 'usa' - - # Test for non-existent enum name - assert isinstance(TestCountryCodesEnum.FAKE, Undefined) - + assert TestCountryCodesEnum.CA.name == 'CA' + assert TestCountryCodesEnum('canada').name == 'CA' def test_dataclass_asdict_returns_expected_paddle_str_enum_value(): - class TestCountryCodesEnum(PaddleStrEnum): - CA = 'canada' - US = 'usa' - + class TestCountryCodesEnum(PaddleStrEnum, metaclass=PaddleStrEnumMeta): + CA: "TestCountryCodesEnum" = 'canada' + US: "TestCountryCodesEnum" = 'usa' @dataclass class TestDataclass: - country_code: TestCountryCodesEnum | Undefined = Undefined() + country_code: TestCountryCodesEnum = None def get_parameters(self) -> dict: return asdict(self) @@ -49,4 +45,27 @@ def get_parameters(self) -> dict: assert is_dataclass(test_dataclass) assert isinstance(test_dataclass.get_parameters(), dict) assert test_dataclass.get_parameters().get('country_code', None) is not None - assert type(test_dataclass.get_parameters().get('country_code', None)) == Undefined + assert isinstance(test_dataclass.get_parameters().get('country_code', None), TestCountryCodesEnum) + assert test_dataclass.get_parameters().get('country_code', TestCountryCodesEnum.CA).is_known() == False + + +def test_paddle_str_enum_gracefully_handles_missing_values(): + class TestCountryCodesEnum(PaddleStrEnum, metaclass=PaddleStrEnumMeta): + CA: "TestCountryCodesEnum" = 'canada' + US: "TestCountryCodesEnum" = 'usa' + + assert isinstance(TestCountryCodesEnum.FR, TestCountryCodesEnum) + assert isinstance(TestCountryCodesEnum('france'), TestCountryCodesEnum) + + # Via constructor + assert TestCountryCodesEnum('france') == 'france' + assert TestCountryCodesEnum('france').value == 'france' + assert TestCountryCodesEnum('france').name == 'Undefined' + assert not TestCountryCodesEnum('france').is_known() + + # Via missing attr + assert TestCountryCodesEnum.France == 'france' + assert TestCountryCodesEnum.France.value == 'france' + assert TestCountryCodesEnum.France.name == 'Undefined' + assert not TestCountryCodesEnum.France.is_known() + From 1ed3dbb3b2475632b08c86e452f28fcb7820f4c7 Mon Sep 17 00:00:00 2001 From: Michael Woodward Date: Sat, 3 Aug 2024 10:34:26 +0100 Subject: [PATCH 2/2] Add type hints to enum consts --- .../Entities/Discounts/DiscountStatus.py | 8 +- .../Entities/Discounts/DiscountType.py | 6 +- .../Entities/Events/EventTypeName.py | 96 ++-- .../NotificationSettingType.py | 4 +- .../Notifications/NotificationOrigin.py | 4 +- .../Notifications/NotificationPayoutStatus.py | 4 +- .../Notifications/NotificationStatus.py | 8 +- .../Entities/Reports/ReportFilterName.py | 26 +- .../Entities/Reports/ReportFilterOperator.py | 4 +- .../Entities/Reports/ReportStatus.py | 8 +- paddle_billing/Entities/Reports/ReportType.py | 12 +- paddle_billing/Entities/Shared/Action.py | 12 +- .../Entities/Shared/AdjustmentStatus.py | 8 +- .../Entities/Shared/AdjustmentType.py | 8 +- .../Shared/AvailablePaymentMethods.py | 14 +- paddle_billing/Entities/Shared/CatalogType.py | 4 +- .../Entities/Shared/CollectionMode.py | 4 +- paddle_billing/Entities/Shared/CountryCode.py | 458 +++++++++--------- .../Entities/Shared/CurrencyCode.py | 60 +-- .../Shared/CurrencyCodeAdjustments.py | 6 +- .../Entities/Shared/CurrencyCodePayouts.py | 26 +- paddle_billing/Entities/Shared/ErrorCode.py | 34 +- paddle_billing/Entities/Shared/Interval.py | 8 +- .../Entities/Shared/PaymentAttemptStatus.py | 18 +- .../Entities/Shared/PaymentMethodType.py | 20 +- paddle_billing/Entities/Shared/Status.py | 4 +- paddle_billing/Entities/Shared/TaxCategory.py | 18 +- paddle_billing/Entities/Shared/TaxMode.py | 6 +- .../Entities/Shared/TransactionOrigin.py | 12 +- .../Entities/Shared/TransactionStatus.py | 14 +- .../SubscriptionEffectiveFrom.py | 4 +- .../Subscriptions/SubscriptionItemStatus.py | 6 +- .../SubscriptionOnPaymentFailure.py | 4 +- .../SubscriptionProrationBillingMode.py | 10 +- .../Subscriptions/SubscriptionResultAction.py | 4 +- .../SubscriptionResumeEffectiveFrom.py | 2 +- .../SubscriptionScheduledChangeAction.py | 6 +- .../Subscriptions/SubscriptionStatus.py | 12 +- .../Transactions/TransactionCardType.py | 20 +- .../Entities/Discounts/DiscountStatus.py | 8 +- .../Entities/Discounts/DiscountType.py | 6 +- .../Entities/Payouts/PayoutStatus.py | 4 +- .../Entities/Reports/ReportFilterName.py | 26 +- .../Entities/Reports/ReportFilterOperator.py | 4 +- .../Entities/Reports/ReportStatus.py | 8 +- .../Entities/Reports/ReportType.py | 12 +- .../Notifications/Entities/Shared/Action.py | 12 +- .../Entities/Shared/AdjustmentStatus.py | 8 +- .../Entities/Shared/AdjustmentType.py | 8 +- .../Shared/AvailablePaymentMethods.py | 14 +- .../Entities/Shared/CatalogType.py | 4 +- .../Entities/Shared/CollectionMode.py | 4 +- .../Entities/Shared/CountryCode.py | 458 +++++++++--------- .../Entities/Shared/CurrencyCode.py | 60 +-- .../Shared/CurrencyCodeAdjustments.py | 6 +- .../Entities/Shared/CurrencyCodePayouts.py | 26 +- .../Entities/Shared/ErrorCode.py | 34 +- .../Notifications/Entities/Shared/Interval.py | 8 +- .../Entities/Shared/PaymentAttemptStatus.py | 18 +- .../Entities/Shared/PaymentMethodType.py | 22 +- .../Notifications/Entities/Shared/Status.py | 4 +- .../Entities/Shared/TaxCategory.py | 18 +- .../Notifications/Entities/Shared/TaxMode.py | 6 +- .../Entities/Shared/TransactionOrigin.py | 12 +- .../Entities/Shared/TransactionStatus.py | 14 +- .../SubscriptionEffectiveFrom.py | 4 +- .../Subscriptions/SubscriptionItemStatus.py | 6 +- .../SubscriptionOnPaymentFailure.py | 4 +- .../SubscriptionScheduledChangeAction.py | 6 +- .../Subscriptions/SubscriptionStatus.py | 12 +- .../Transactions/TransactionCardType.py | 20 +- .../Prices/Operations/List/Includes.py | 2 +- .../Products/Operations/List/Includes.py | 2 +- .../Shared/Operations/List/Comparator.py | 8 +- .../Subscriptions/Operations/Get/Includes.py | 4 +- .../Transactions/Operations/List/Includes.py | 14 +- .../Transactions/Operations/List/Origin.py | 12 +- 77 files changed, 940 insertions(+), 940 deletions(-) diff --git a/paddle_billing/Entities/Discounts/DiscountStatus.py b/paddle_billing/Entities/Discounts/DiscountStatus.py index 8e866505..768a2f60 100644 --- a/paddle_billing/Entities/Discounts/DiscountStatus.py +++ b/paddle_billing/Entities/Discounts/DiscountStatus.py @@ -2,7 +2,7 @@ class DiscountStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Archived = 'archived' - Expired = 'expired' - Used = 'used' + Active: "DiscountStatus" = 'active' + Archived: "DiscountStatus" = 'archived' + Expired: "DiscountStatus" = 'expired' + Used: "DiscountStatus" = 'used' diff --git a/paddle_billing/Entities/Discounts/DiscountType.py b/paddle_billing/Entities/Discounts/DiscountType.py index 7c43e9a0..8be856f1 100644 --- a/paddle_billing/Entities/Discounts/DiscountType.py +++ b/paddle_billing/Entities/Discounts/DiscountType.py @@ -2,6 +2,6 @@ class DiscountType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Flat = 'flat' - FlatPerSeat = 'flat_per_seat' - Percentage = 'percentage' + Flat: "DiscountType" = 'flat' + FlatPerSeat: "DiscountType" = 'flat_per_seat' + Percentage: "DiscountType" = 'percentage' diff --git a/paddle_billing/Entities/Events/EventTypeName.py b/paddle_billing/Entities/Events/EventTypeName.py index 5594dd7e..a900d5da 100644 --- a/paddle_billing/Entities/Events/EventTypeName.py +++ b/paddle_billing/Entities/Events/EventTypeName.py @@ -2,51 +2,51 @@ class EventTypeName(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AddressCreated = 'address.created' - AddressImported = 'address.imported' - AddressUpdated = 'address.updated' - AdjustmentCreated = 'adjustment.created' - AdjustmentUpdated = 'adjustment.updated' - BusinessCreated = 'business.created' - BusinessImported = 'business.imported' - BusinessUpdated = 'business.updated' - CustomerCreated = 'customer.created' - CustomerImported = 'customer.imported' - CustomerUpdated = 'customer.updated' - DiscountCreated = 'discount.created' - DiscountImported = 'discount.imported' - DiscountUpdated = 'discount.updated' - InvoiceCanceled = 'invoice.canceled' - InvoiceCreated = 'invoice.created' - InvoiceIssued = 'invoice.issued' - InvoiceOverdue = 'invoice.overdue' - InvoicePaid = 'invoice.paid' - InvoiceScheduled = 'invoice.scheduled' - PayoutCreated = 'payout.created' - PayoutPaid = 'payout.paid' - PriceCreated = 'price.created' - PriceUpdated = 'price.updated' - PriceImported = 'price.imported' - ProductCreated = 'product.created' - ProductUpdated = 'product.updated' - ProductImported = 'product.imported' - SubscriptionActivated = 'subscription.activated' - SubscriptionCanceled = 'subscription.canceled' - SubscriptionCreated = 'subscription.created' - SubscriptionImported = 'subscription.imported' - SubscriptionPastDue = 'subscription.past_due' - SubscriptionPaused = 'subscription.paused' - SubscriptionResumed = 'subscription.resumed' - SubscriptionTrialing = 'subscription.trialing' - SubscriptionUpdated = 'subscription.updated' - TransactionBilled = 'transaction.billed' - TransactionCanceled = 'transaction.canceled' - TransactionCompleted = 'transaction.completed' - TransactionCreated = 'transaction.created' - TransactionPaid = 'transaction.paid' - TransactionPastDue = 'transaction.past_due' - TransactionPaymentFailed = 'transaction.payment_failed' - TransactionReady = 'transaction.ready' - TransactionUpdated = 'transaction.updated' - ReportCreated = 'report.created' - ReportUpdated = 'report.updated' + AddressCreated: "EventTypeName" = 'address.created' + AddressImported: "EventTypeName" = 'address.imported' + AddressUpdated: "EventTypeName" = 'address.updated' + AdjustmentCreated: "EventTypeName" = 'adjustment.created' + AdjustmentUpdated: "EventTypeName" = 'adjustment.updated' + BusinessCreated: "EventTypeName" = 'business.created' + BusinessImported: "EventTypeName" = 'business.imported' + BusinessUpdated: "EventTypeName" = 'business.updated' + CustomerCreated: "EventTypeName" = 'customer.created' + CustomerImported: "EventTypeName" = 'customer.imported' + CustomerUpdated: "EventTypeName" = 'customer.updated' + DiscountCreated: "EventTypeName" = 'discount.created' + DiscountImported: "EventTypeName" = 'discount.imported' + DiscountUpdated: "EventTypeName" = 'discount.updated' + InvoiceCanceled: "EventTypeName" = 'invoice.canceled' + InvoiceCreated: "EventTypeName" = 'invoice.created' + InvoiceIssued: "EventTypeName" = 'invoice.issued' + InvoiceOverdue: "EventTypeName" = 'invoice.overdue' + InvoicePaid: "EventTypeName" = 'invoice.paid' + InvoiceScheduled: "EventTypeName" = 'invoice.scheduled' + PayoutCreated: "EventTypeName" = 'payout.created' + PayoutPaid: "EventTypeName" = 'payout.paid' + PriceCreated: "EventTypeName" = 'price.created' + PriceUpdated: "EventTypeName" = 'price.updated' + PriceImported: "EventTypeName" = 'price.imported' + ProductCreated: "EventTypeName" = 'product.created' + ProductUpdated: "EventTypeName" = 'product.updated' + ProductImported: "EventTypeName" = 'product.imported' + SubscriptionActivated: "EventTypeName" = 'subscription.activated' + SubscriptionCanceled: "EventTypeName" = 'subscription.canceled' + SubscriptionCreated: "EventTypeName" = 'subscription.created' + SubscriptionImported: "EventTypeName" = 'subscription.imported' + SubscriptionPastDue: "EventTypeName" = 'subscription.past_due' + SubscriptionPaused: "EventTypeName" = 'subscription.paused' + SubscriptionResumed: "EventTypeName" = 'subscription.resumed' + SubscriptionTrialing: "EventTypeName" = 'subscription.trialing' + SubscriptionUpdated: "EventTypeName" = 'subscription.updated' + TransactionBilled: "EventTypeName" = 'transaction.billed' + TransactionCanceled: "EventTypeName" = 'transaction.canceled' + TransactionCompleted: "EventTypeName" = 'transaction.completed' + TransactionCreated: "EventTypeName" = 'transaction.created' + TransactionPaid: "EventTypeName" = 'transaction.paid' + TransactionPastDue: "EventTypeName" = 'transaction.past_due' + TransactionPaymentFailed: "EventTypeName" = 'transaction.payment_failed' + TransactionReady: "EventTypeName" = 'transaction.ready' + TransactionUpdated: "EventTypeName" = 'transaction.updated' + ReportCreated: "EventTypeName" = 'report.created' + ReportUpdated: "EventTypeName" = 'report.updated' diff --git a/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py b/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py index b9f444d4..d6049625 100644 --- a/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py +++ b/paddle_billing/Entities/NotificationSettings/NotificationSettingType.py @@ -2,5 +2,5 @@ class NotificationSettingType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Email = 'email' - Url = 'url' + Email: "NotificationSettingType" = 'email' + Url: "NotificationSettingType" = 'url' diff --git a/paddle_billing/Entities/Notifications/NotificationOrigin.py b/paddle_billing/Entities/Notifications/NotificationOrigin.py index 253aa00d..226b84ee 100644 --- a/paddle_billing/Entities/Notifications/NotificationOrigin.py +++ b/paddle_billing/Entities/Notifications/NotificationOrigin.py @@ -2,5 +2,5 @@ class NotificationOrigin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Event = 'event' - Replay = 'replay' + Event: "NotificationOrigin" = 'event' + Replay: "NotificationOrigin" = 'replay' diff --git a/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py b/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py index 4f5dd2a6..15436f68 100644 --- a/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py +++ b/paddle_billing/Entities/Notifications/NotificationPayoutStatus.py @@ -2,5 +2,5 @@ class NotificationPayoutStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Unpaid = 'unpaid' - Paid = 'paid' + Unpaid: "NotificationPayoutStatus" = 'unpaid' + Paid: "NotificationPayoutStatus" = 'paid' diff --git a/paddle_billing/Entities/Notifications/NotificationStatus.py b/paddle_billing/Entities/Notifications/NotificationStatus.py index 285156c0..469a3c04 100644 --- a/paddle_billing/Entities/Notifications/NotificationStatus.py +++ b/paddle_billing/Entities/Notifications/NotificationStatus.py @@ -2,7 +2,7 @@ class NotificationStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - NotAttempted = 'not_attempted' - NeedsRetry = 'needs_retry' - Delivered = 'delivered' - Failed = 'failed' + NotAttempted: "NotificationStatus" = 'not_attempted' + NeedsRetry: "NotificationStatus" = 'needs_retry' + Delivered: "NotificationStatus" = 'delivered' + Failed: "NotificationStatus" = 'failed' diff --git a/paddle_billing/Entities/Reports/ReportFilterName.py b/paddle_billing/Entities/Reports/ReportFilterName.py index c0d89d0c..6c0b2f80 100644 --- a/paddle_billing/Entities/Reports/ReportFilterName.py +++ b/paddle_billing/Entities/Reports/ReportFilterName.py @@ -2,16 +2,16 @@ class ReportFilterName(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Action = 'action' - CollectionMode = 'collection_mode' - CurrencyCode = 'currency_code' - Origin = 'origin' - PriceStatus = 'price_status' - PriceType = 'price_type' - PriceUpdatedAt = 'price_updated_at' - ProductStatus = 'product_status' - ProductType = 'product_type' - ProductUpdatedAt = 'product_updated_at' - Status = 'status' - Type = 'type' - UpdatedAt = 'updated_at' + Action: "ReportFilterName" = 'action' + CollectionMode: "ReportFilterName" = 'collection_mode' + CurrencyCode: "ReportFilterName" = 'currency_code' + Origin: "ReportFilterName" = 'origin' + PriceStatus: "ReportFilterName" = 'price_status' + PriceType: "ReportFilterName" = 'price_type' + PriceUpdatedAt: "ReportFilterName" = 'price_updated_at' + ProductStatus: "ReportFilterName" = 'product_status' + ProductType: "ReportFilterName" = 'product_type' + ProductUpdatedAt: "ReportFilterName" = 'product_updated_at' + Status: "ReportFilterName" = 'status' + Type: "ReportFilterName" = 'type' + UpdatedAt: "ReportFilterName" = 'updated_at' diff --git a/paddle_billing/Entities/Reports/ReportFilterOperator.py b/paddle_billing/Entities/Reports/ReportFilterOperator.py index 16974c4b..41c74af7 100644 --- a/paddle_billing/Entities/Reports/ReportFilterOperator.py +++ b/paddle_billing/Entities/Reports/ReportFilterOperator.py @@ -2,5 +2,5 @@ class ReportFilterOperator(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Lt = 'lt' - Gte = 'gte' + Lt: "ReportFilterOperator" = 'lt' + Gte: "ReportFilterOperator" = 'gte' diff --git a/paddle_billing/Entities/Reports/ReportStatus.py b/paddle_billing/Entities/Reports/ReportStatus.py index 1af7955f..27dde70a 100644 --- a/paddle_billing/Entities/Reports/ReportStatus.py +++ b/paddle_billing/Entities/Reports/ReportStatus.py @@ -2,7 +2,7 @@ class ReportStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Pending = 'pending' - Ready = 'ready' - Failed = 'failed' - Expired = 'expired' + Pending: "ReportStatus" = 'pending' + Ready: "ReportStatus" = 'ready' + Failed: "ReportStatus" = 'failed' + Expired: "ReportStatus" = 'expired' diff --git a/paddle_billing/Entities/Reports/ReportType.py b/paddle_billing/Entities/Reports/ReportType.py index 922769a3..d78ab93f 100644 --- a/paddle_billing/Entities/Reports/ReportType.py +++ b/paddle_billing/Entities/Reports/ReportType.py @@ -2,9 +2,9 @@ class ReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Adjustments = 'adjustments' - AdjustmentLineItems = 'adjustment_line_items' - Discounts = 'discounts' - ProductsPrices = 'products_prices' - Transactions = 'transactions' - TransactionLineItems = 'transaction_line_items' + Adjustments: "ReportType" = 'adjustments' + AdjustmentLineItems: "ReportType" = 'adjustment_line_items' + Discounts: "ReportType" = 'discounts' + ProductsPrices: "ReportType" = 'products_prices' + Transactions: "ReportType" = 'transactions' + TransactionLineItems: "ReportType" = 'transaction_line_items' diff --git a/paddle_billing/Entities/Shared/Action.py b/paddle_billing/Entities/Shared/Action.py index d512be63..d0739dcc 100644 --- a/paddle_billing/Entities/Shared/Action.py +++ b/paddle_billing/Entities/Shared/Action.py @@ -2,9 +2,9 @@ class Action(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Credit = 'credit' - CreditReverse = 'credit_reverse' - Refund = 'refund' - Chargeback = 'chargeback' - ChargebackReverse = 'chargeback_reverse' - ChargebackWarning = 'chargeback_warning' + Credit: "Action" = 'credit' + CreditReverse: "Action" = 'credit_reverse' + Refund: "Action" = 'refund' + Chargeback: "Action" = 'chargeback' + ChargebackReverse: "Action" = 'chargeback_reverse' + ChargebackWarning: "Action" = 'chargeback_warning' diff --git a/paddle_billing/Entities/Shared/AdjustmentStatus.py b/paddle_billing/Entities/Shared/AdjustmentStatus.py index 0115c6e5..8ffb0bd3 100644 --- a/paddle_billing/Entities/Shared/AdjustmentStatus.py +++ b/paddle_billing/Entities/Shared/AdjustmentStatus.py @@ -2,7 +2,7 @@ class AdjustmentStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - PendingApproval = 'pending_approval' - Approved = 'approved' - Rejected = 'rejected' - Reversed = 'reversed' + PendingApproval: "AdjustmentStatus" = 'pending_approval' + Approved: "AdjustmentStatus" = 'approved' + Rejected: "AdjustmentStatus" = 'rejected' + Reversed: "AdjustmentStatus" = 'reversed' diff --git a/paddle_billing/Entities/Shared/AdjustmentType.py b/paddle_billing/Entities/Shared/AdjustmentType.py index 8d4cc7ad..f3a3f4ce 100644 --- a/paddle_billing/Entities/Shared/AdjustmentType.py +++ b/paddle_billing/Entities/Shared/AdjustmentType.py @@ -2,7 +2,7 @@ class AdjustmentType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Full = 'full' - Partial = 'partial' - Tax = 'tax' - Proration = 'proration' + Full: "AdjustmentType" = 'full' + Partial: "AdjustmentType" = 'partial' + Tax: "AdjustmentType" = 'tax' + Proration: "AdjustmentType" = 'proration' diff --git a/paddle_billing/Entities/Shared/AvailablePaymentMethods.py b/paddle_billing/Entities/Shared/AvailablePaymentMethods.py index 5c7457a4..a06aec6e 100644 --- a/paddle_billing/Entities/Shared/AvailablePaymentMethods.py +++ b/paddle_billing/Entities/Shared/AvailablePaymentMethods.py @@ -2,10 +2,10 @@ class AvailablePaymentMethods(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Alipay = 'alipay' - ApplePay = 'apple_pay' - Bancontact = 'bancontact' - Card = 'card' - GooglePay = 'google_pay' - Ideal = 'ideal' - Paypal = 'paypal' + Alipay: "AvailablePaymentMethods" = 'alipay' + ApplePay: "AvailablePaymentMethods" = 'apple_pay' + Bancontact: "AvailablePaymentMethods" = 'bancontact' + Card: "AvailablePaymentMethods" = 'card' + GooglePay: "AvailablePaymentMethods" = 'google_pay' + Ideal: "AvailablePaymentMethods" = 'ideal' + Paypal: "AvailablePaymentMethods" = 'paypal' diff --git a/paddle_billing/Entities/Shared/CatalogType.py b/paddle_billing/Entities/Shared/CatalogType.py index 0dfa728d..6d1260d3 100644 --- a/paddle_billing/Entities/Shared/CatalogType.py +++ b/paddle_billing/Entities/Shared/CatalogType.py @@ -2,5 +2,5 @@ class CatalogType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Standard = 'standard' - Custom = 'custom' + Standard: "CatalogType" = 'standard' + Custom: "CatalogType" = 'custom' diff --git a/paddle_billing/Entities/Shared/CollectionMode.py b/paddle_billing/Entities/Shared/CollectionMode.py index 924a4657..ca8eb823 100644 --- a/paddle_billing/Entities/Shared/CollectionMode.py +++ b/paddle_billing/Entities/Shared/CollectionMode.py @@ -2,5 +2,5 @@ class CollectionMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Automatic = 'automatic' - Manual = 'manual' + Automatic: "CollectionMode" = 'automatic' + Manual: "CollectionMode" = 'manual' diff --git a/paddle_billing/Entities/Shared/CountryCode.py b/paddle_billing/Entities/Shared/CountryCode.py index 7f513bfe..ec1d0179 100644 --- a/paddle_billing/Entities/Shared/CountryCode.py +++ b/paddle_billing/Entities/Shared/CountryCode.py @@ -2,232 +2,232 @@ class CountryCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AD = 'AD' - AE = 'AE' - AG = 'AG' - AI = 'AI' - AL = 'AL' - AM = 'AM' - AO = 'AO' - AR = 'AR' - AS = 'AS' - AT = 'AT' - AU = 'AU' - AW = 'AW' - AX = 'AX' - AZ = 'AZ' - BA = 'BA' - BB = 'BB' - BD = 'BD' - BE = 'BE' - BF = 'BF' - BG = 'BG' - BH = 'BH' - BI = 'BI' - BJ = 'BJ' - BL = 'BL' - BM = 'BM' - BN = 'BN' - BO = 'BO' - BQ = 'BQ' - BR = 'BR' - BS = 'BS' - BT = 'BT' - BV = 'BV' - BW = 'BW' - BZ = 'BZ' - CA = 'CA' - CC = 'CC' - CG = 'CG' - CH = 'CH' - CI = 'CI' - CK = 'CK' - CL = 'CL' - CM = 'CM' - CN = 'CN' - CO = 'CO' - CR = 'CR' - CV = 'CV' - CW = 'CW' - CX = 'CX' - CY = 'CY' - CZ = 'CZ' - DE = 'DE' - DJ = 'DJ' - DK = 'DK' - DM = 'DM' - DO = 'DO' - DZ = 'DZ' - EC = 'EC' - EE = 'EE' - EG = 'EG' - EH = 'EH' - ER = 'ER' - ES = 'ES' - ET = 'ET' - FI = 'FI' - FJ = 'FJ' - FK = 'FK' - FM = 'FM' - FO = 'FO' - FR = 'FR' - GA = 'GA' - GB = 'GB' - GD = 'GD' - GE = 'GE' - GF = 'GF' - GG = 'GG' - GH = 'GH' - GI = 'GI' - GL = 'GL' - GM = 'GM' - GN = 'GN' - GP = 'GP' - GQ = 'GQ' - GR = 'GR' - GS = 'GS' - GT = 'GT' - GU = 'GU' - GW = 'GW' - GY = 'GY' - HK = 'HK' - HM = 'HM' - HN = 'HN' - HR = 'HR' - HU = 'HU' - ID = 'ID' - IE = 'IE' - IL = 'IL' - IM = 'IM' - IN = 'IN' - IO = 'IO' - IQ = 'IQ' - IS = 'IS' - IT = 'IT' - JE = 'JE' - JM = 'JM' - JO = 'JO' - JP = 'JP' - KE = 'KE' - KG = 'KG' - KH = 'KH' - KI = 'KI' - KM = 'KM' - KN = 'KN' - KR = 'KR' - KW = 'KW' - KY = 'KY' - KZ = 'KZ' - LA = 'LA' - LB = 'LB' - LC = 'LC' - LI = 'LI' - LK = 'LK' - LR = 'LR' - LS = 'LS' - LT = 'LT' - LU = 'LU' - LV = 'LV' - MA = 'MA' - MC = 'MC' - MD = 'MD' - ME = 'ME' - MF = 'MF' - MG = 'MG' - MH = 'MH' - MK = 'MK' - MN = 'MN' - MO = 'MO' - MP = 'MP' - MQ = 'MQ' - MR = 'MR' - MS = 'MS' - MT = 'MT' - MU = 'MU' - MV = 'MV' - MW = 'MW' - MX = 'MX' - MY = 'MY' - MZ = 'MZ' - NA = 'NA' - NC = 'NC' - NE = 'NE' - NF = 'NF' - NG = 'NG' - NL = 'NL' - NO = 'NO' - NP = 'NP' - NR = 'NR' - NU = 'NU' - NZ = 'NZ' - OM = 'OM' - PA = 'PA' - PE = 'PE' - PF = 'PF' - PG = 'PG' - PH = 'PH' - PK = 'PK' - PL = 'PL' - PM = 'PM' - PN = 'PN' - PR = 'PR' - PS = 'PS' - PT = 'PT' - PW = 'PW' - PY = 'PY' - QA = 'QA' - RE = 'RE' - RO = 'RO' - RS = 'RS' - RW = 'RW' - SA = 'SA' - SB = 'SB' - SC = 'SC' - SE = 'SE' - SG = 'SG' - SH = 'SH' - SI = 'SI' - SJ = 'SJ' - SK = 'SK' - SL = 'SL' - SM = 'SM' - SN = 'SN' - SR = 'SR' - ST = 'ST' - SV = 'SV' - SX = 'SX' - SZ = 'SZ' - TC = 'TC' - TD = 'TD' - TF = 'TF' - TG = 'TG' - TH = 'TH' - TJ = 'TJ' - TK = 'TK' - TL = 'TL' - TM = 'TM' - TN = 'TN' - TO = 'TO' - TR = 'TR' - TT = 'TT' - TV = 'TV' - TW = 'TW' - TZ = 'TZ' - UA = 'UA' - UG = 'UG' - UM = 'UM' - US = 'US' - UY = 'UY' - UZ = 'UZ' - VA = 'VA' - VC = 'VC' - VG = 'VG' - VI = 'VI' - VN = 'VN' - VU = 'VU' - WF = 'WF' - WS = 'WS' - XK = 'XK' - YT = 'YT' - ZA = 'ZA' - ZM = 'ZM' + AD: "CountryCode" = 'AD' + AE: "CountryCode" = 'AE' + AG: "CountryCode" = 'AG' + AI: "CountryCode" = 'AI' + AL: "CountryCode" = 'AL' + AM: "CountryCode" = 'AM' + AO: "CountryCode" = 'AO' + AR: "CountryCode" = 'AR' + AS: "CountryCode" = 'AS' + AT: "CountryCode" = 'AT' + AU: "CountryCode" = 'AU' + AW: "CountryCode" = 'AW' + AX: "CountryCode" = 'AX' + AZ: "CountryCode" = 'AZ' + BA: "CountryCode" = 'BA' + BB: "CountryCode" = 'BB' + BD: "CountryCode" = 'BD' + BE: "CountryCode" = 'BE' + BF: "CountryCode" = 'BF' + BG: "CountryCode" = 'BG' + BH: "CountryCode" = 'BH' + BI: "CountryCode" = 'BI' + BJ: "CountryCode" = 'BJ' + BL: "CountryCode" = 'BL' + BM: "CountryCode" = 'BM' + BN: "CountryCode" = 'BN' + BO: "CountryCode" = 'BO' + BQ: "CountryCode" = 'BQ' + BR: "CountryCode" = 'BR' + BS: "CountryCode" = 'BS' + BT: "CountryCode" = 'BT' + BV: "CountryCode" = 'BV' + BW: "CountryCode" = 'BW' + BZ: "CountryCode" = 'BZ' + CA: "CountryCode" = 'CA' + CC: "CountryCode" = 'CC' + CG: "CountryCode" = 'CG' + CH: "CountryCode" = 'CH' + CI: "CountryCode" = 'CI' + CK: "CountryCode" = 'CK' + CL: "CountryCode" = 'CL' + CM: "CountryCode" = 'CM' + CN: "CountryCode" = 'CN' + CO: "CountryCode" = 'CO' + CR: "CountryCode" = 'CR' + CV: "CountryCode" = 'CV' + CW: "CountryCode" = 'CW' + CX: "CountryCode" = 'CX' + CY: "CountryCode" = 'CY' + CZ: "CountryCode" = 'CZ' + DE: "CountryCode" = 'DE' + DJ: "CountryCode" = 'DJ' + DK: "CountryCode" = 'DK' + DM: "CountryCode" = 'DM' + DO: "CountryCode" = 'DO' + DZ: "CountryCode" = 'DZ' + EC: "CountryCode" = 'EC' + EE: "CountryCode" = 'EE' + EG: "CountryCode" = 'EG' + EH: "CountryCode" = 'EH' + ER: "CountryCode" = 'ER' + ES: "CountryCode" = 'ES' + ET: "CountryCode" = 'ET' + FI: "CountryCode" = 'FI' + FJ: "CountryCode" = 'FJ' + FK: "CountryCode" = 'FK' + FM: "CountryCode" = 'FM' + FO: "CountryCode" = 'FO' + FR: "CountryCode" = 'FR' + GA: "CountryCode" = 'GA' + GB: "CountryCode" = 'GB' + GD: "CountryCode" = 'GD' + GE: "CountryCode" = 'GE' + GF: "CountryCode" = 'GF' + GG: "CountryCode" = 'GG' + GH: "CountryCode" = 'GH' + GI: "CountryCode" = 'GI' + GL: "CountryCode" = 'GL' + GM: "CountryCode" = 'GM' + GN: "CountryCode" = 'GN' + GP: "CountryCode" = 'GP' + GQ: "CountryCode" = 'GQ' + GR: "CountryCode" = 'GR' + GS: "CountryCode" = 'GS' + GT: "CountryCode" = 'GT' + GU: "CountryCode" = 'GU' + GW: "CountryCode" = 'GW' + GY: "CountryCode" = 'GY' + HK: "CountryCode" = 'HK' + HM: "CountryCode" = 'HM' + HN: "CountryCode" = 'HN' + HR: "CountryCode" = 'HR' + HU: "CountryCode" = 'HU' + ID: "CountryCode" = 'ID' + IE: "CountryCode" = 'IE' + IL: "CountryCode" = 'IL' + IM: "CountryCode" = 'IM' + IN: "CountryCode" = 'IN' + IO: "CountryCode" = 'IO' + IQ: "CountryCode" = 'IQ' + IS: "CountryCode" = 'IS' + IT: "CountryCode" = 'IT' + JE: "CountryCode" = 'JE' + JM: "CountryCode" = 'JM' + JO: "CountryCode" = 'JO' + JP: "CountryCode" = 'JP' + KE: "CountryCode" = 'KE' + KG: "CountryCode" = 'KG' + KH: "CountryCode" = 'KH' + KI: "CountryCode" = 'KI' + KM: "CountryCode" = 'KM' + KN: "CountryCode" = 'KN' + KR: "CountryCode" = 'KR' + KW: "CountryCode" = 'KW' + KY: "CountryCode" = 'KY' + KZ: "CountryCode" = 'KZ' + LA: "CountryCode" = 'LA' + LB: "CountryCode" = 'LB' + LC: "CountryCode" = 'LC' + LI: "CountryCode" = 'LI' + LK: "CountryCode" = 'LK' + LR: "CountryCode" = 'LR' + LS: "CountryCode" = 'LS' + LT: "CountryCode" = 'LT' + LU: "CountryCode" = 'LU' + LV: "CountryCode" = 'LV' + MA: "CountryCode" = 'MA' + MC: "CountryCode" = 'MC' + MD: "CountryCode" = 'MD' + ME: "CountryCode" = 'ME' + MF: "CountryCode" = 'MF' + MG: "CountryCode" = 'MG' + MH: "CountryCode" = 'MH' + MK: "CountryCode" = 'MK' + MN: "CountryCode" = 'MN' + MO: "CountryCode" = 'MO' + MP: "CountryCode" = 'MP' + MQ: "CountryCode" = 'MQ' + MR: "CountryCode" = 'MR' + MS: "CountryCode" = 'MS' + MT: "CountryCode" = 'MT' + MU: "CountryCode" = 'MU' + MV: "CountryCode" = 'MV' + MW: "CountryCode" = 'MW' + MX: "CountryCode" = 'MX' + MY: "CountryCode" = 'MY' + MZ: "CountryCode" = 'MZ' + NA: "CountryCode" = 'NA' + NC: "CountryCode" = 'NC' + NE: "CountryCode" = 'NE' + NF: "CountryCode" = 'NF' + NG: "CountryCode" = 'NG' + NL: "CountryCode" = 'NL' + NO: "CountryCode" = 'NO' + NP: "CountryCode" = 'NP' + NR: "CountryCode" = 'NR' + NU: "CountryCode" = 'NU' + NZ: "CountryCode" = 'NZ' + OM: "CountryCode" = 'OM' + PA: "CountryCode" = 'PA' + PE: "CountryCode" = 'PE' + PF: "CountryCode" = 'PF' + PG: "CountryCode" = 'PG' + PH: "CountryCode" = 'PH' + PK: "CountryCode" = 'PK' + PL: "CountryCode" = 'PL' + PM: "CountryCode" = 'PM' + PN: "CountryCode" = 'PN' + PR: "CountryCode" = 'PR' + PS: "CountryCode" = 'PS' + PT: "CountryCode" = 'PT' + PW: "CountryCode" = 'PW' + PY: "CountryCode" = 'PY' + QA: "CountryCode" = 'QA' + RE: "CountryCode" = 'RE' + RO: "CountryCode" = 'RO' + RS: "CountryCode" = 'RS' + RW: "CountryCode" = 'RW' + SA: "CountryCode" = 'SA' + SB: "CountryCode" = 'SB' + SC: "CountryCode" = 'SC' + SE: "CountryCode" = 'SE' + SG: "CountryCode" = 'SG' + SH: "CountryCode" = 'SH' + SI: "CountryCode" = 'SI' + SJ: "CountryCode" = 'SJ' + SK: "CountryCode" = 'SK' + SL: "CountryCode" = 'SL' + SM: "CountryCode" = 'SM' + SN: "CountryCode" = 'SN' + SR: "CountryCode" = 'SR' + ST: "CountryCode" = 'ST' + SV: "CountryCode" = 'SV' + SX: "CountryCode" = 'SX' + SZ: "CountryCode" = 'SZ' + TC: "CountryCode" = 'TC' + TD: "CountryCode" = 'TD' + TF: "CountryCode" = 'TF' + TG: "CountryCode" = 'TG' + TH: "CountryCode" = 'TH' + TJ: "CountryCode" = 'TJ' + TK: "CountryCode" = 'TK' + TL: "CountryCode" = 'TL' + TM: "CountryCode" = 'TM' + TN: "CountryCode" = 'TN' + TO: "CountryCode" = 'TO' + TR: "CountryCode" = 'TR' + TT: "CountryCode" = 'TT' + TV: "CountryCode" = 'TV' + TW: "CountryCode" = 'TW' + TZ: "CountryCode" = 'TZ' + UA: "CountryCode" = 'UA' + UG: "CountryCode" = 'UG' + UM: "CountryCode" = 'UM' + US: "CountryCode" = 'US' + UY: "CountryCode" = 'UY' + UZ: "CountryCode" = 'UZ' + VA: "CountryCode" = 'VA' + VC: "CountryCode" = 'VC' + VG: "CountryCode" = 'VG' + VI: "CountryCode" = 'VI' + VN: "CountryCode" = 'VN' + VU: "CountryCode" = 'VU' + WF: "CountryCode" = 'WF' + WS: "CountryCode" = 'WS' + XK: "CountryCode" = 'XK' + YT: "CountryCode" = 'YT' + ZA: "CountryCode" = 'ZA' + ZM: "CountryCode" = 'ZM' diff --git a/paddle_billing/Entities/Shared/CurrencyCode.py b/paddle_billing/Entities/Shared/CurrencyCode.py index ea31b0e5..93baaa7f 100644 --- a/paddle_billing/Entities/Shared/CurrencyCode.py +++ b/paddle_billing/Entities/Shared/CurrencyCode.py @@ -2,33 +2,33 @@ class CurrencyCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - USD = 'USD' - EUR = 'EUR' - GBP = 'GBP' - JPY = 'JPY' - AUD = 'AUD' - CAD = 'CAD' - CHF = 'CHF' - HKD = 'HKD' - SGD = 'SGD' - SEK = 'SEK' - ARS = 'ARS' - BRL = 'BRL' - CNY = 'CNY' - COP = 'COP' - CZK = 'CZK' - DKK = 'DKK' - HUF = 'HUF' - ILS = 'ILS' - INR = 'INR' - KRW = 'KRW' - MXN = 'MXN' - NOK = 'NOK' - NZD = 'NZD' - PLN = 'PLN' - RUB = 'RUB' - THB = 'THB' - TRY = 'TRY' - TWD = 'TWD' - UAH = 'UAH' - ZAR = 'ZAR' + USD: "CurrencyCode" = 'USD' + EUR: "CurrencyCode" = 'EUR' + GBP: "CurrencyCode" = 'GBP' + JPY: "CurrencyCode" = 'JPY' + AUD: "CurrencyCode" = 'AUD' + CAD: "CurrencyCode" = 'CAD' + CHF: "CurrencyCode" = 'CHF' + HKD: "CurrencyCode" = 'HKD' + SGD: "CurrencyCode" = 'SGD' + SEK: "CurrencyCode" = 'SEK' + ARS: "CurrencyCode" = 'ARS' + BRL: "CurrencyCode" = 'BRL' + CNY: "CurrencyCode" = 'CNY' + COP: "CurrencyCode" = 'COP' + CZK: "CurrencyCode" = 'CZK' + DKK: "CurrencyCode" = 'DKK' + HUF: "CurrencyCode" = 'HUF' + ILS: "CurrencyCode" = 'ILS' + INR: "CurrencyCode" = 'INR' + KRW: "CurrencyCode" = 'KRW' + MXN: "CurrencyCode" = 'MXN' + NOK: "CurrencyCode" = 'NOK' + NZD: "CurrencyCode" = 'NZD' + PLN: "CurrencyCode" = 'PLN' + RUB: "CurrencyCode" = 'RUB' + THB: "CurrencyCode" = 'THB' + TRY: "CurrencyCode" = 'TRY' + TWD: "CurrencyCode" = 'TWD' + UAH: "CurrencyCode" = 'UAH' + ZAR: "CurrencyCode" = 'ZAR' diff --git a/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py b/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py index c57e11c9..c5b6e3fb 100644 --- a/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py +++ b/paddle_billing/Entities/Shared/CurrencyCodeAdjustments.py @@ -2,6 +2,6 @@ class CurrencyCodeAdjustments(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - EUR = 'EUR' - GBP = 'GBP' - USD = 'USD' + EUR: "CurrencyCodeAdjustments" = 'EUR' + GBP: "CurrencyCodeAdjustments" = 'GBP' + USD: "CurrencyCodeAdjustments" = 'USD' diff --git a/paddle_billing/Entities/Shared/CurrencyCodePayouts.py b/paddle_billing/Entities/Shared/CurrencyCodePayouts.py index 27787954..40eb2284 100644 --- a/paddle_billing/Entities/Shared/CurrencyCodePayouts.py +++ b/paddle_billing/Entities/Shared/CurrencyCodePayouts.py @@ -2,16 +2,16 @@ class CurrencyCodePayouts(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AUD = 'AUD' - CAD = 'CAD' - CHF = 'CHF' - CNY = 'CNY' - CZK = 'CZK' - DKK = 'DKK' - EUR = 'EUR' - GBP = 'GBP' - HUF = 'HUF' - PLN = 'PLN' - SEK = 'SEK' - USD = 'USD' - ZAR = 'ZAR' + AUD: "CurrencyCodePayouts" = 'AUD' + CAD: "CurrencyCodePayouts" = 'CAD' + CHF: "CurrencyCodePayouts" = 'CHF' + CNY: "CurrencyCodePayouts" = 'CNY' + CZK: "CurrencyCodePayouts" = 'CZK' + DKK: "CurrencyCodePayouts" = 'DKK' + EUR: "CurrencyCodePayouts" = 'EUR' + GBP: "CurrencyCodePayouts" = 'GBP' + HUF: "CurrencyCodePayouts" = 'HUF' + PLN: "CurrencyCodePayouts" = 'PLN' + SEK: "CurrencyCodePayouts" = 'SEK' + USD: "CurrencyCodePayouts" = 'USD' + ZAR: "CurrencyCodePayouts" = 'ZAR' diff --git a/paddle_billing/Entities/Shared/ErrorCode.py b/paddle_billing/Entities/Shared/ErrorCode.py index bf4256df..df517cb1 100644 --- a/paddle_billing/Entities/Shared/ErrorCode.py +++ b/paddle_billing/Entities/Shared/ErrorCode.py @@ -2,20 +2,20 @@ class ErrorCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AlreadyCanceled = 'already_canceled' - AlreadyRefunded = 'already_refunded' - AuthenticationFailed = 'authentication_failed' - BlockedCard = 'blocked_card' - Canceled = 'canceled' - Declined = 'declined' - ExpiredCard = 'expired_card' - Fraud = 'fraud' - InvalidAmount = 'invalid_amount' - InvalidPaymentDetails = 'invalid_payment_details' - IssuerUnavailable = 'issuer_unavailable' - NotEnoughBalance = 'not_enough_balance' - PspError = 'psp_error' - RedactedPaymentMethod = 'redacted_payment_method' - SystemError = 'system_error' - TransactionNotPermitted = 'transaction_not_permitted' - Unknown = 'unknown' + AlreadyCanceled: "ErrorCode" = 'already_canceled' + AlreadyRefunded: "ErrorCode" = 'already_refunded' + AuthenticationFailed: "ErrorCode" = 'authentication_failed' + BlockedCard: "ErrorCode" = 'blocked_card' + Canceled: "ErrorCode" = 'canceled' + Declined: "ErrorCode" = 'declined' + ExpiredCard: "ErrorCode" = 'expired_card' + Fraud: "ErrorCode" = 'fraud' + InvalidAmount: "ErrorCode" = 'invalid_amount' + InvalidPaymentDetails: "ErrorCode" = 'invalid_payment_details' + IssuerUnavailable: "ErrorCode" = 'issuer_unavailable' + NotEnoughBalance: "ErrorCode" = 'not_enough_balance' + PspError: "ErrorCode" = 'psp_error' + RedactedPaymentMethod: "ErrorCode" = 'redacted_payment_method' + SystemError: "ErrorCode" = 'system_error' + TransactionNotPermitted: "ErrorCode" = 'transaction_not_permitted' + Unknown: "ErrorCode" = 'unknown' diff --git a/paddle_billing/Entities/Shared/Interval.py b/paddle_billing/Entities/Shared/Interval.py index 3648ea26..4d874f5d 100644 --- a/paddle_billing/Entities/Shared/Interval.py +++ b/paddle_billing/Entities/Shared/Interval.py @@ -2,7 +2,7 @@ class Interval(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Day = 'day' - Week = 'week' - Month = 'month' - Year = 'year' + Day: "Interval" = 'day' + Week: "Interval" = 'week' + Month: "Interval" = 'month' + Year: "Interval" = 'year' diff --git a/paddle_billing/Entities/Shared/PaymentAttemptStatus.py b/paddle_billing/Entities/Shared/PaymentAttemptStatus.py index 6c296b08..84f0d05e 100644 --- a/paddle_billing/Entities/Shared/PaymentAttemptStatus.py +++ b/paddle_billing/Entities/Shared/PaymentAttemptStatus.py @@ -2,12 +2,12 @@ class PaymentAttemptStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Authorized = 'authorized' - AuthorizedFlagged = 'authorized_flagged' - Canceled = 'canceled' - Captured = 'captured' - Error = 'error' - ActionRequired = 'action_required' - PendingNoActionRequired = 'pending_no_action_required' - Created = 'created' - Unknown = 'unknown' + Authorized: "PaymentAttemptStatus" = 'authorized' + AuthorizedFlagged: "PaymentAttemptStatus" = 'authorized_flagged' + Canceled: "PaymentAttemptStatus" = 'canceled' + Captured: "PaymentAttemptStatus" = 'captured' + Error: "PaymentAttemptStatus" = 'error' + ActionRequired: "PaymentAttemptStatus" = 'action_required' + PendingNoActionRequired: "PaymentAttemptStatus" = 'pending_no_action_required' + Created: "PaymentAttemptStatus" = 'created' + Unknown: "PaymentAttemptStatus" = 'unknown' diff --git a/paddle_billing/Entities/Shared/PaymentMethodType.py b/paddle_billing/Entities/Shared/PaymentMethodType.py index 8a935360..f5c28ee0 100644 --- a/paddle_billing/Entities/Shared/PaymentMethodType.py +++ b/paddle_billing/Entities/Shared/PaymentMethodType.py @@ -2,13 +2,13 @@ class PaymentMethodType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Alipay = 'alipay' - ApplePay = 'apple_pay' - Bancontact = 'bancontact' - Card = 'card' - GooglePay = 'google_pay' - Ideal = 'ideal' - Offline = 'offline' - Paypal = 'paypal' - Unknown = 'unknown' - WireTransfer = 'wire_transfer' + Alipay: "PaymentMethodType" = 'alipay' + ApplePay: "PaymentMethodType" = 'apple_pay' + Bancontact: "PaymentMethodType" = 'bancontact' + Card: "PaymentMethodType" = 'card' + GooglePay: "PaymentMethodType" = 'google_pay' + Ideal: "PaymentMethodType" = 'ideal' + Offline: "PaymentMethodType" = 'offline' + Paypal: "PaymentMethodType" = 'paypal' + Unknown: "PaymentMethodType" = 'unknown' + WireTransfer: "PaymentMethodType" = 'wire_transfer' diff --git a/paddle_billing/Entities/Shared/Status.py b/paddle_billing/Entities/Shared/Status.py index e86eef94..4ad0dba6 100644 --- a/paddle_billing/Entities/Shared/Status.py +++ b/paddle_billing/Entities/Shared/Status.py @@ -2,5 +2,5 @@ class Status(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Archived = 'archived' + Active: "Status" = 'active' + Archived: "Status" = 'archived' diff --git a/paddle_billing/Entities/Shared/TaxCategory.py b/paddle_billing/Entities/Shared/TaxCategory.py index d350d9f7..0663aae5 100644 --- a/paddle_billing/Entities/Shared/TaxCategory.py +++ b/paddle_billing/Entities/Shared/TaxCategory.py @@ -2,12 +2,12 @@ class TaxCategory(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - DigitalGoods = 'digital-goods' - Ebooks = 'ebooks' - ImplementationServices = 'implementation-services' - ProfessionalServices = 'professional-services' - Saas = 'saas' - SoftwareProgrammingServices = 'software-programming-services' - Standard = 'standard' - TrainingServices = 'training-services' - WebsiteHosting = 'website-hosting' + DigitalGoods: "TaxCategory" = 'digital-goods' + Ebooks: "TaxCategory" = 'ebooks' + ImplementationServices: "TaxCategory" = 'implementation-services' + ProfessionalServices: "TaxCategory" = 'professional-services' + Saas: "TaxCategory" = 'saas' + SoftwareProgrammingServices: "TaxCategory" = 'software-programming-services' + Standard: "TaxCategory" = 'standard' + TrainingServices: "TaxCategory" = 'training-services' + WebsiteHosting: "TaxCategory" = 'website-hosting' diff --git a/paddle_billing/Entities/Shared/TaxMode.py b/paddle_billing/Entities/Shared/TaxMode.py index 0624829c..b7b54616 100644 --- a/paddle_billing/Entities/Shared/TaxMode.py +++ b/paddle_billing/Entities/Shared/TaxMode.py @@ -2,6 +2,6 @@ class TaxMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AccountSetting = 'account_setting' - External = 'external' - Internal = 'internal' + AccountSetting: "TaxMode" = 'account_setting' + External: "TaxMode" = 'external' + Internal: "TaxMode" = 'internal' diff --git a/paddle_billing/Entities/Shared/TransactionOrigin.py b/paddle_billing/Entities/Shared/TransactionOrigin.py index 70e58776..46baa3ec 100644 --- a/paddle_billing/Entities/Shared/TransactionOrigin.py +++ b/paddle_billing/Entities/Shared/TransactionOrigin.py @@ -2,9 +2,9 @@ class TransactionOrigin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Api = 'api' - SubscriptionCharge = 'subscription_charge' - SubscriptionPaymentMethodChange = 'subscription_payment_method_change' - SubscriptionRecurring = 'subscription_recurring' - SubscriptionUpdate = 'subscription_update' - Web = 'web' + Api: "TransactionOrigin" = 'api' + SubscriptionCharge: "TransactionOrigin" = 'subscription_charge' + SubscriptionPaymentMethodChange: "TransactionOrigin" = 'subscription_payment_method_change' + SubscriptionRecurring: "TransactionOrigin" = 'subscription_recurring' + SubscriptionUpdate: "TransactionOrigin" = 'subscription_update' + Web: "TransactionOrigin" = 'web' diff --git a/paddle_billing/Entities/Shared/TransactionStatus.py b/paddle_billing/Entities/Shared/TransactionStatus.py index 8fd24e74..d2e40378 100644 --- a/paddle_billing/Entities/Shared/TransactionStatus.py +++ b/paddle_billing/Entities/Shared/TransactionStatus.py @@ -2,10 +2,10 @@ class TransactionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Draft = 'draft' - Ready = 'ready' - Billed = 'billed' - Paid = 'paid' - Completed = 'completed' - Canceled = 'canceled' - PastDue = 'past_due' + Draft: "TransactionStatus" = 'draft' + Ready: "TransactionStatus" = 'ready' + Billed: "TransactionStatus" = 'billed' + Paid: "TransactionStatus" = 'paid' + Completed: "TransactionStatus" = 'completed' + Canceled: "TransactionStatus" = 'canceled' + PastDue: "TransactionStatus" = 'past_due' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py b/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py index 14d074dc..88c9f3ca 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py @@ -2,5 +2,5 @@ class SubscriptionEffectiveFrom(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - NextBillingPeriod = 'next_billing_period' - Immediately = 'immediately' + NextBillingPeriod: "SubscriptionEffectiveFrom" = 'next_billing_period' + Immediately: "SubscriptionEffectiveFrom" = 'immediately' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py b/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py index e84167c6..de920a8c 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py @@ -2,6 +2,6 @@ class SubscriptionItemStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Inactive = 'inactive' - Trialing = 'trialing' + Active: "SubscriptionItemStatus" = 'active' + Inactive: "SubscriptionItemStatus" = 'inactive' + Trialing: "SubscriptionItemStatus" = 'trialing' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py b/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py index fce66853..af2daed6 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionOnPaymentFailure.py @@ -2,5 +2,5 @@ class SubscriptionOnPaymentFailure(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - PreventChange = 'prevent_change' - ApplyChange = 'apply_change' + PreventChange: "SubscriptionOnPaymentFailure" = 'prevent_change' + ApplyChange: "SubscriptionOnPaymentFailure" = 'apply_change' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py b/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py index 2388677a..f441b7a3 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionProrationBillingMode.py @@ -2,8 +2,8 @@ class SubscriptionProrationBillingMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - ProratedImmediately = 'prorated_immediately' - ProratedNextBillingPeriod = 'prorated_next_billing_period' - FullImmediately = 'full_immediately' - FullNextBillingPeriod = 'full_next_billing_period' - DoNotBill = 'do_not_bill' + ProratedImmediately: "SubscriptionProrationBillingMode" = 'prorated_immediately' + ProratedNextBillingPeriod: "SubscriptionProrationBillingMode" = 'prorated_next_billing_period' + FullImmediately: "SubscriptionProrationBillingMode" = 'full_immediately' + FullNextBillingPeriod: "SubscriptionProrationBillingMode" = 'full_next_billing_period' + DoNotBill: "SubscriptionProrationBillingMode" = 'do_not_bill' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py b/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py index a234b0be..d798b4ff 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionResultAction.py @@ -2,5 +2,5 @@ class SubscriptionResultAction(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Credit = 'credit' - Charge = 'charge' + Credit: "SubscriptionResultAction" = 'credit' + Charge: "SubscriptionResultAction" = 'charge' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py b/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py index 7c4ac109..d190c018 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionResumeEffectiveFrom.py @@ -2,4 +2,4 @@ class SubscriptionResumeEffectiveFrom(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Immediately = 'immediately' + Immediately: "SubscriptionResumeEffectiveFrom" = 'immediately' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py b/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py index 0617ebaf..576e62e2 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionScheduledChangeAction.py @@ -2,6 +2,6 @@ class SubscriptionScheduledChangeAction(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Cancel = 'cancel' - Pause = 'pause' - Resume = 'resume' + Cancel: "SubscriptionScheduledChangeAction" = 'cancel' + Pause: "SubscriptionScheduledChangeAction" = 'pause' + Resume: "SubscriptionScheduledChangeAction" = 'resume' diff --git a/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py b/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py index 8da54014..c54e0046 100644 --- a/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py +++ b/paddle_billing/Entities/Subscriptions/SubscriptionStatus.py @@ -2,9 +2,9 @@ class SubscriptionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Canceled = 'canceled' - PastDue = 'past_due' - Paused = 'paused' - Trialing = 'trialing' - Inactive = 'inactive' + Active: "SubscriptionStatus" = 'active' + Canceled: "SubscriptionStatus" = 'canceled' + PastDue: "SubscriptionStatus" = 'past_due' + Paused: "SubscriptionStatus" = 'paused' + Trialing: "SubscriptionStatus" = 'trialing' + Inactive: "SubscriptionStatus" = 'inactive' diff --git a/paddle_billing/Entities/Transactions/TransactionCardType.py b/paddle_billing/Entities/Transactions/TransactionCardType.py index 99cb0294..039bf339 100644 --- a/paddle_billing/Entities/Transactions/TransactionCardType.py +++ b/paddle_billing/Entities/Transactions/TransactionCardType.py @@ -2,13 +2,13 @@ class TransactionCardType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AmericanExpress = 'american_express' - DinersClub = 'diners_club' - Discover = 'discover' - Jcb = 'jcb' - Mada = 'mada' - Maestro = 'maestro' - Mastercard = 'mastercard' - UnionPay = 'union_pay' - Unknown = 'unknown' - Visa = 'visa' + AmericanExpress: "TransactionCardType" = 'american_express' + DinersClub: "TransactionCardType" = 'diners_club' + Discover: "TransactionCardType" = 'discover' + Jcb: "TransactionCardType" = 'jcb' + Mada: "TransactionCardType" = 'mada' + Maestro: "TransactionCardType" = 'maestro' + Mastercard: "TransactionCardType" = 'mastercard' + UnionPay: "TransactionCardType" = 'union_pay' + Unknown: "TransactionCardType" = 'unknown' + Visa: "TransactionCardType" = 'visa' diff --git a/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py b/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py index 8e866505..768a2f60 100644 --- a/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py +++ b/paddle_billing/Notifications/Entities/Discounts/DiscountStatus.py @@ -2,7 +2,7 @@ class DiscountStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Archived = 'archived' - Expired = 'expired' - Used = 'used' + Active: "DiscountStatus" = 'active' + Archived: "DiscountStatus" = 'archived' + Expired: "DiscountStatus" = 'expired' + Used: "DiscountStatus" = 'used' diff --git a/paddle_billing/Notifications/Entities/Discounts/DiscountType.py b/paddle_billing/Notifications/Entities/Discounts/DiscountType.py index 7c43e9a0..8be856f1 100644 --- a/paddle_billing/Notifications/Entities/Discounts/DiscountType.py +++ b/paddle_billing/Notifications/Entities/Discounts/DiscountType.py @@ -2,6 +2,6 @@ class DiscountType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Flat = 'flat' - FlatPerSeat = 'flat_per_seat' - Percentage = 'percentage' + Flat: "DiscountType" = 'flat' + FlatPerSeat: "DiscountType" = 'flat_per_seat' + Percentage: "DiscountType" = 'percentage' diff --git a/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py b/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py index ec03d07c..a35a2f31 100644 --- a/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py +++ b/paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py @@ -2,5 +2,5 @@ class PayoutStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Unpaid = 'unpaid' - Paid = 'paid' + Unpaid: "PayoutStatus" = 'unpaid' + Paid: "PayoutStatus" = 'paid' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py b/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py index c0d89d0c..6c0b2f80 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportFilterName.py @@ -2,16 +2,16 @@ class ReportFilterName(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Action = 'action' - CollectionMode = 'collection_mode' - CurrencyCode = 'currency_code' - Origin = 'origin' - PriceStatus = 'price_status' - PriceType = 'price_type' - PriceUpdatedAt = 'price_updated_at' - ProductStatus = 'product_status' - ProductType = 'product_type' - ProductUpdatedAt = 'product_updated_at' - Status = 'status' - Type = 'type' - UpdatedAt = 'updated_at' + Action: "ReportFilterName" = 'action' + CollectionMode: "ReportFilterName" = 'collection_mode' + CurrencyCode: "ReportFilterName" = 'currency_code' + Origin: "ReportFilterName" = 'origin' + PriceStatus: "ReportFilterName" = 'price_status' + PriceType: "ReportFilterName" = 'price_type' + PriceUpdatedAt: "ReportFilterName" = 'price_updated_at' + ProductStatus: "ReportFilterName" = 'product_status' + ProductType: "ReportFilterName" = 'product_type' + ProductUpdatedAt: "ReportFilterName" = 'product_updated_at' + Status: "ReportFilterName" = 'status' + Type: "ReportFilterName" = 'type' + UpdatedAt: "ReportFilterName" = 'updated_at' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py b/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py index 16974c4b..41c74af7 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py @@ -2,5 +2,5 @@ class ReportFilterOperator(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Lt = 'lt' - Gte = 'gte' + Lt: "ReportFilterOperator" = 'lt' + Gte: "ReportFilterOperator" = 'gte' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportStatus.py b/paddle_billing/Notifications/Entities/Reports/ReportStatus.py index 1af7955f..27dde70a 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportStatus.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportStatus.py @@ -2,7 +2,7 @@ class ReportStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Pending = 'pending' - Ready = 'ready' - Failed = 'failed' - Expired = 'expired' + Pending: "ReportStatus" = 'pending' + Ready: "ReportStatus" = 'ready' + Failed: "ReportStatus" = 'failed' + Expired: "ReportStatus" = 'expired' diff --git a/paddle_billing/Notifications/Entities/Reports/ReportType.py b/paddle_billing/Notifications/Entities/Reports/ReportType.py index 922769a3..d78ab93f 100644 --- a/paddle_billing/Notifications/Entities/Reports/ReportType.py +++ b/paddle_billing/Notifications/Entities/Reports/ReportType.py @@ -2,9 +2,9 @@ class ReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Adjustments = 'adjustments' - AdjustmentLineItems = 'adjustment_line_items' - Discounts = 'discounts' - ProductsPrices = 'products_prices' - Transactions = 'transactions' - TransactionLineItems = 'transaction_line_items' + Adjustments: "ReportType" = 'adjustments' + AdjustmentLineItems: "ReportType" = 'adjustment_line_items' + Discounts: "ReportType" = 'discounts' + ProductsPrices: "ReportType" = 'products_prices' + Transactions: "ReportType" = 'transactions' + TransactionLineItems: "ReportType" = 'transaction_line_items' diff --git a/paddle_billing/Notifications/Entities/Shared/Action.py b/paddle_billing/Notifications/Entities/Shared/Action.py index d512be63..d0739dcc 100644 --- a/paddle_billing/Notifications/Entities/Shared/Action.py +++ b/paddle_billing/Notifications/Entities/Shared/Action.py @@ -2,9 +2,9 @@ class Action(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Credit = 'credit' - CreditReverse = 'credit_reverse' - Refund = 'refund' - Chargeback = 'chargeback' - ChargebackReverse = 'chargeback_reverse' - ChargebackWarning = 'chargeback_warning' + Credit: "Action" = 'credit' + CreditReverse: "Action" = 'credit_reverse' + Refund: "Action" = 'refund' + Chargeback: "Action" = 'chargeback' + ChargebackReverse: "Action" = 'chargeback_reverse' + ChargebackWarning: "Action" = 'chargeback_warning' diff --git a/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py b/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py index 0115c6e5..8ffb0bd3 100644 --- a/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py +++ b/paddle_billing/Notifications/Entities/Shared/AdjustmentStatus.py @@ -2,7 +2,7 @@ class AdjustmentStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - PendingApproval = 'pending_approval' - Approved = 'approved' - Rejected = 'rejected' - Reversed = 'reversed' + PendingApproval: "AdjustmentStatus" = 'pending_approval' + Approved: "AdjustmentStatus" = 'approved' + Rejected: "AdjustmentStatus" = 'rejected' + Reversed: "AdjustmentStatus" = 'reversed' diff --git a/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py b/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py index 8d4cc7ad..f3a3f4ce 100644 --- a/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py +++ b/paddle_billing/Notifications/Entities/Shared/AdjustmentType.py @@ -2,7 +2,7 @@ class AdjustmentType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Full = 'full' - Partial = 'partial' - Tax = 'tax' - Proration = 'proration' + Full: "AdjustmentType" = 'full' + Partial: "AdjustmentType" = 'partial' + Tax: "AdjustmentType" = 'tax' + Proration: "AdjustmentType" = 'proration' diff --git a/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py b/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py index 5c7457a4..a06aec6e 100644 --- a/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py +++ b/paddle_billing/Notifications/Entities/Shared/AvailablePaymentMethods.py @@ -2,10 +2,10 @@ class AvailablePaymentMethods(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Alipay = 'alipay' - ApplePay = 'apple_pay' - Bancontact = 'bancontact' - Card = 'card' - GooglePay = 'google_pay' - Ideal = 'ideal' - Paypal = 'paypal' + Alipay: "AvailablePaymentMethods" = 'alipay' + ApplePay: "AvailablePaymentMethods" = 'apple_pay' + Bancontact: "AvailablePaymentMethods" = 'bancontact' + Card: "AvailablePaymentMethods" = 'card' + GooglePay: "AvailablePaymentMethods" = 'google_pay' + Ideal: "AvailablePaymentMethods" = 'ideal' + Paypal: "AvailablePaymentMethods" = 'paypal' diff --git a/paddle_billing/Notifications/Entities/Shared/CatalogType.py b/paddle_billing/Notifications/Entities/Shared/CatalogType.py index 0dfa728d..6d1260d3 100644 --- a/paddle_billing/Notifications/Entities/Shared/CatalogType.py +++ b/paddle_billing/Notifications/Entities/Shared/CatalogType.py @@ -2,5 +2,5 @@ class CatalogType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Standard = 'standard' - Custom = 'custom' + Standard: "CatalogType" = 'standard' + Custom: "CatalogType" = 'custom' diff --git a/paddle_billing/Notifications/Entities/Shared/CollectionMode.py b/paddle_billing/Notifications/Entities/Shared/CollectionMode.py index 924a4657..ca8eb823 100644 --- a/paddle_billing/Notifications/Entities/Shared/CollectionMode.py +++ b/paddle_billing/Notifications/Entities/Shared/CollectionMode.py @@ -2,5 +2,5 @@ class CollectionMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Automatic = 'automatic' - Manual = 'manual' + Automatic: "CollectionMode" = 'automatic' + Manual: "CollectionMode" = 'manual' diff --git a/paddle_billing/Notifications/Entities/Shared/CountryCode.py b/paddle_billing/Notifications/Entities/Shared/CountryCode.py index 7f513bfe..ec1d0179 100644 --- a/paddle_billing/Notifications/Entities/Shared/CountryCode.py +++ b/paddle_billing/Notifications/Entities/Shared/CountryCode.py @@ -2,232 +2,232 @@ class CountryCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AD = 'AD' - AE = 'AE' - AG = 'AG' - AI = 'AI' - AL = 'AL' - AM = 'AM' - AO = 'AO' - AR = 'AR' - AS = 'AS' - AT = 'AT' - AU = 'AU' - AW = 'AW' - AX = 'AX' - AZ = 'AZ' - BA = 'BA' - BB = 'BB' - BD = 'BD' - BE = 'BE' - BF = 'BF' - BG = 'BG' - BH = 'BH' - BI = 'BI' - BJ = 'BJ' - BL = 'BL' - BM = 'BM' - BN = 'BN' - BO = 'BO' - BQ = 'BQ' - BR = 'BR' - BS = 'BS' - BT = 'BT' - BV = 'BV' - BW = 'BW' - BZ = 'BZ' - CA = 'CA' - CC = 'CC' - CG = 'CG' - CH = 'CH' - CI = 'CI' - CK = 'CK' - CL = 'CL' - CM = 'CM' - CN = 'CN' - CO = 'CO' - CR = 'CR' - CV = 'CV' - CW = 'CW' - CX = 'CX' - CY = 'CY' - CZ = 'CZ' - DE = 'DE' - DJ = 'DJ' - DK = 'DK' - DM = 'DM' - DO = 'DO' - DZ = 'DZ' - EC = 'EC' - EE = 'EE' - EG = 'EG' - EH = 'EH' - ER = 'ER' - ES = 'ES' - ET = 'ET' - FI = 'FI' - FJ = 'FJ' - FK = 'FK' - FM = 'FM' - FO = 'FO' - FR = 'FR' - GA = 'GA' - GB = 'GB' - GD = 'GD' - GE = 'GE' - GF = 'GF' - GG = 'GG' - GH = 'GH' - GI = 'GI' - GL = 'GL' - GM = 'GM' - GN = 'GN' - GP = 'GP' - GQ = 'GQ' - GR = 'GR' - GS = 'GS' - GT = 'GT' - GU = 'GU' - GW = 'GW' - GY = 'GY' - HK = 'HK' - HM = 'HM' - HN = 'HN' - HR = 'HR' - HU = 'HU' - ID = 'ID' - IE = 'IE' - IL = 'IL' - IM = 'IM' - IN = 'IN' - IO = 'IO' - IQ = 'IQ' - IS = 'IS' - IT = 'IT' - JE = 'JE' - JM = 'JM' - JO = 'JO' - JP = 'JP' - KE = 'KE' - KG = 'KG' - KH = 'KH' - KI = 'KI' - KM = 'KM' - KN = 'KN' - KR = 'KR' - KW = 'KW' - KY = 'KY' - KZ = 'KZ' - LA = 'LA' - LB = 'LB' - LC = 'LC' - LI = 'LI' - LK = 'LK' - LR = 'LR' - LS = 'LS' - LT = 'LT' - LU = 'LU' - LV = 'LV' - MA = 'MA' - MC = 'MC' - MD = 'MD' - ME = 'ME' - MF = 'MF' - MG = 'MG' - MH = 'MH' - MK = 'MK' - MN = 'MN' - MO = 'MO' - MP = 'MP' - MQ = 'MQ' - MR = 'MR' - MS = 'MS' - MT = 'MT' - MU = 'MU' - MV = 'MV' - MW = 'MW' - MX = 'MX' - MY = 'MY' - MZ = 'MZ' - NA = 'NA' - NC = 'NC' - NE = 'NE' - NF = 'NF' - NG = 'NG' - NL = 'NL' - NO = 'NO' - NP = 'NP' - NR = 'NR' - NU = 'NU' - NZ = 'NZ' - OM = 'OM' - PA = 'PA' - PE = 'PE' - PF = 'PF' - PG = 'PG' - PH = 'PH' - PK = 'PK' - PL = 'PL' - PM = 'PM' - PN = 'PN' - PR = 'PR' - PS = 'PS' - PT = 'PT' - PW = 'PW' - PY = 'PY' - QA = 'QA' - RE = 'RE' - RO = 'RO' - RS = 'RS' - RW = 'RW' - SA = 'SA' - SB = 'SB' - SC = 'SC' - SE = 'SE' - SG = 'SG' - SH = 'SH' - SI = 'SI' - SJ = 'SJ' - SK = 'SK' - SL = 'SL' - SM = 'SM' - SN = 'SN' - SR = 'SR' - ST = 'ST' - SV = 'SV' - SX = 'SX' - SZ = 'SZ' - TC = 'TC' - TD = 'TD' - TF = 'TF' - TG = 'TG' - TH = 'TH' - TJ = 'TJ' - TK = 'TK' - TL = 'TL' - TM = 'TM' - TN = 'TN' - TO = 'TO' - TR = 'TR' - TT = 'TT' - TV = 'TV' - TW = 'TW' - TZ = 'TZ' - UA = 'UA' - UG = 'UG' - UM = 'UM' - US = 'US' - UY = 'UY' - UZ = 'UZ' - VA = 'VA' - VC = 'VC' - VG = 'VG' - VI = 'VI' - VN = 'VN' - VU = 'VU' - WF = 'WF' - WS = 'WS' - XK = 'XK' - YT = 'YT' - ZA = 'ZA' - ZM = 'ZM' + AD: "CountryCode" = 'AD' + AE: "CountryCode" = 'AE' + AG: "CountryCode" = 'AG' + AI: "CountryCode" = 'AI' + AL: "CountryCode" = 'AL' + AM: "CountryCode" = 'AM' + AO: "CountryCode" = 'AO' + AR: "CountryCode" = 'AR' + AS: "CountryCode" = 'AS' + AT: "CountryCode" = 'AT' + AU: "CountryCode" = 'AU' + AW: "CountryCode" = 'AW' + AX: "CountryCode" = 'AX' + AZ: "CountryCode" = 'AZ' + BA: "CountryCode" = 'BA' + BB: "CountryCode" = 'BB' + BD: "CountryCode" = 'BD' + BE: "CountryCode" = 'BE' + BF: "CountryCode" = 'BF' + BG: "CountryCode" = 'BG' + BH: "CountryCode" = 'BH' + BI: "CountryCode" = 'BI' + BJ: "CountryCode" = 'BJ' + BL: "CountryCode" = 'BL' + BM: "CountryCode" = 'BM' + BN: "CountryCode" = 'BN' + BO: "CountryCode" = 'BO' + BQ: "CountryCode" = 'BQ' + BR: "CountryCode" = 'BR' + BS: "CountryCode" = 'BS' + BT: "CountryCode" = 'BT' + BV: "CountryCode" = 'BV' + BW: "CountryCode" = 'BW' + BZ: "CountryCode" = 'BZ' + CA: "CountryCode" = 'CA' + CC: "CountryCode" = 'CC' + CG: "CountryCode" = 'CG' + CH: "CountryCode" = 'CH' + CI: "CountryCode" = 'CI' + CK: "CountryCode" = 'CK' + CL: "CountryCode" = 'CL' + CM: "CountryCode" = 'CM' + CN: "CountryCode" = 'CN' + CO: "CountryCode" = 'CO' + CR: "CountryCode" = 'CR' + CV: "CountryCode" = 'CV' + CW: "CountryCode" = 'CW' + CX: "CountryCode" = 'CX' + CY: "CountryCode" = 'CY' + CZ: "CountryCode" = 'CZ' + DE: "CountryCode" = 'DE' + DJ: "CountryCode" = 'DJ' + DK: "CountryCode" = 'DK' + DM: "CountryCode" = 'DM' + DO: "CountryCode" = 'DO' + DZ: "CountryCode" = 'DZ' + EC: "CountryCode" = 'EC' + EE: "CountryCode" = 'EE' + EG: "CountryCode" = 'EG' + EH: "CountryCode" = 'EH' + ER: "CountryCode" = 'ER' + ES: "CountryCode" = 'ES' + ET: "CountryCode" = 'ET' + FI: "CountryCode" = 'FI' + FJ: "CountryCode" = 'FJ' + FK: "CountryCode" = 'FK' + FM: "CountryCode" = 'FM' + FO: "CountryCode" = 'FO' + FR: "CountryCode" = 'FR' + GA: "CountryCode" = 'GA' + GB: "CountryCode" = 'GB' + GD: "CountryCode" = 'GD' + GE: "CountryCode" = 'GE' + GF: "CountryCode" = 'GF' + GG: "CountryCode" = 'GG' + GH: "CountryCode" = 'GH' + GI: "CountryCode" = 'GI' + GL: "CountryCode" = 'GL' + GM: "CountryCode" = 'GM' + GN: "CountryCode" = 'GN' + GP: "CountryCode" = 'GP' + GQ: "CountryCode" = 'GQ' + GR: "CountryCode" = 'GR' + GS: "CountryCode" = 'GS' + GT: "CountryCode" = 'GT' + GU: "CountryCode" = 'GU' + GW: "CountryCode" = 'GW' + GY: "CountryCode" = 'GY' + HK: "CountryCode" = 'HK' + HM: "CountryCode" = 'HM' + HN: "CountryCode" = 'HN' + HR: "CountryCode" = 'HR' + HU: "CountryCode" = 'HU' + ID: "CountryCode" = 'ID' + IE: "CountryCode" = 'IE' + IL: "CountryCode" = 'IL' + IM: "CountryCode" = 'IM' + IN: "CountryCode" = 'IN' + IO: "CountryCode" = 'IO' + IQ: "CountryCode" = 'IQ' + IS: "CountryCode" = 'IS' + IT: "CountryCode" = 'IT' + JE: "CountryCode" = 'JE' + JM: "CountryCode" = 'JM' + JO: "CountryCode" = 'JO' + JP: "CountryCode" = 'JP' + KE: "CountryCode" = 'KE' + KG: "CountryCode" = 'KG' + KH: "CountryCode" = 'KH' + KI: "CountryCode" = 'KI' + KM: "CountryCode" = 'KM' + KN: "CountryCode" = 'KN' + KR: "CountryCode" = 'KR' + KW: "CountryCode" = 'KW' + KY: "CountryCode" = 'KY' + KZ: "CountryCode" = 'KZ' + LA: "CountryCode" = 'LA' + LB: "CountryCode" = 'LB' + LC: "CountryCode" = 'LC' + LI: "CountryCode" = 'LI' + LK: "CountryCode" = 'LK' + LR: "CountryCode" = 'LR' + LS: "CountryCode" = 'LS' + LT: "CountryCode" = 'LT' + LU: "CountryCode" = 'LU' + LV: "CountryCode" = 'LV' + MA: "CountryCode" = 'MA' + MC: "CountryCode" = 'MC' + MD: "CountryCode" = 'MD' + ME: "CountryCode" = 'ME' + MF: "CountryCode" = 'MF' + MG: "CountryCode" = 'MG' + MH: "CountryCode" = 'MH' + MK: "CountryCode" = 'MK' + MN: "CountryCode" = 'MN' + MO: "CountryCode" = 'MO' + MP: "CountryCode" = 'MP' + MQ: "CountryCode" = 'MQ' + MR: "CountryCode" = 'MR' + MS: "CountryCode" = 'MS' + MT: "CountryCode" = 'MT' + MU: "CountryCode" = 'MU' + MV: "CountryCode" = 'MV' + MW: "CountryCode" = 'MW' + MX: "CountryCode" = 'MX' + MY: "CountryCode" = 'MY' + MZ: "CountryCode" = 'MZ' + NA: "CountryCode" = 'NA' + NC: "CountryCode" = 'NC' + NE: "CountryCode" = 'NE' + NF: "CountryCode" = 'NF' + NG: "CountryCode" = 'NG' + NL: "CountryCode" = 'NL' + NO: "CountryCode" = 'NO' + NP: "CountryCode" = 'NP' + NR: "CountryCode" = 'NR' + NU: "CountryCode" = 'NU' + NZ: "CountryCode" = 'NZ' + OM: "CountryCode" = 'OM' + PA: "CountryCode" = 'PA' + PE: "CountryCode" = 'PE' + PF: "CountryCode" = 'PF' + PG: "CountryCode" = 'PG' + PH: "CountryCode" = 'PH' + PK: "CountryCode" = 'PK' + PL: "CountryCode" = 'PL' + PM: "CountryCode" = 'PM' + PN: "CountryCode" = 'PN' + PR: "CountryCode" = 'PR' + PS: "CountryCode" = 'PS' + PT: "CountryCode" = 'PT' + PW: "CountryCode" = 'PW' + PY: "CountryCode" = 'PY' + QA: "CountryCode" = 'QA' + RE: "CountryCode" = 'RE' + RO: "CountryCode" = 'RO' + RS: "CountryCode" = 'RS' + RW: "CountryCode" = 'RW' + SA: "CountryCode" = 'SA' + SB: "CountryCode" = 'SB' + SC: "CountryCode" = 'SC' + SE: "CountryCode" = 'SE' + SG: "CountryCode" = 'SG' + SH: "CountryCode" = 'SH' + SI: "CountryCode" = 'SI' + SJ: "CountryCode" = 'SJ' + SK: "CountryCode" = 'SK' + SL: "CountryCode" = 'SL' + SM: "CountryCode" = 'SM' + SN: "CountryCode" = 'SN' + SR: "CountryCode" = 'SR' + ST: "CountryCode" = 'ST' + SV: "CountryCode" = 'SV' + SX: "CountryCode" = 'SX' + SZ: "CountryCode" = 'SZ' + TC: "CountryCode" = 'TC' + TD: "CountryCode" = 'TD' + TF: "CountryCode" = 'TF' + TG: "CountryCode" = 'TG' + TH: "CountryCode" = 'TH' + TJ: "CountryCode" = 'TJ' + TK: "CountryCode" = 'TK' + TL: "CountryCode" = 'TL' + TM: "CountryCode" = 'TM' + TN: "CountryCode" = 'TN' + TO: "CountryCode" = 'TO' + TR: "CountryCode" = 'TR' + TT: "CountryCode" = 'TT' + TV: "CountryCode" = 'TV' + TW: "CountryCode" = 'TW' + TZ: "CountryCode" = 'TZ' + UA: "CountryCode" = 'UA' + UG: "CountryCode" = 'UG' + UM: "CountryCode" = 'UM' + US: "CountryCode" = 'US' + UY: "CountryCode" = 'UY' + UZ: "CountryCode" = 'UZ' + VA: "CountryCode" = 'VA' + VC: "CountryCode" = 'VC' + VG: "CountryCode" = 'VG' + VI: "CountryCode" = 'VI' + VN: "CountryCode" = 'VN' + VU: "CountryCode" = 'VU' + WF: "CountryCode" = 'WF' + WS: "CountryCode" = 'WS' + XK: "CountryCode" = 'XK' + YT: "CountryCode" = 'YT' + ZA: "CountryCode" = 'ZA' + ZM: "CountryCode" = 'ZM' diff --git a/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py b/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py index ea31b0e5..93baaa7f 100644 --- a/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py +++ b/paddle_billing/Notifications/Entities/Shared/CurrencyCode.py @@ -2,33 +2,33 @@ class CurrencyCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - USD = 'USD' - EUR = 'EUR' - GBP = 'GBP' - JPY = 'JPY' - AUD = 'AUD' - CAD = 'CAD' - CHF = 'CHF' - HKD = 'HKD' - SGD = 'SGD' - SEK = 'SEK' - ARS = 'ARS' - BRL = 'BRL' - CNY = 'CNY' - COP = 'COP' - CZK = 'CZK' - DKK = 'DKK' - HUF = 'HUF' - ILS = 'ILS' - INR = 'INR' - KRW = 'KRW' - MXN = 'MXN' - NOK = 'NOK' - NZD = 'NZD' - PLN = 'PLN' - RUB = 'RUB' - THB = 'THB' - TRY = 'TRY' - TWD = 'TWD' - UAH = 'UAH' - ZAR = 'ZAR' + USD: "CurrencyCode" = 'USD' + EUR: "CurrencyCode" = 'EUR' + GBP: "CurrencyCode" = 'GBP' + JPY: "CurrencyCode" = 'JPY' + AUD: "CurrencyCode" = 'AUD' + CAD: "CurrencyCode" = 'CAD' + CHF: "CurrencyCode" = 'CHF' + HKD: "CurrencyCode" = 'HKD' + SGD: "CurrencyCode" = 'SGD' + SEK: "CurrencyCode" = 'SEK' + ARS: "CurrencyCode" = 'ARS' + BRL: "CurrencyCode" = 'BRL' + CNY: "CurrencyCode" = 'CNY' + COP: "CurrencyCode" = 'COP' + CZK: "CurrencyCode" = 'CZK' + DKK: "CurrencyCode" = 'DKK' + HUF: "CurrencyCode" = 'HUF' + ILS: "CurrencyCode" = 'ILS' + INR: "CurrencyCode" = 'INR' + KRW: "CurrencyCode" = 'KRW' + MXN: "CurrencyCode" = 'MXN' + NOK: "CurrencyCode" = 'NOK' + NZD: "CurrencyCode" = 'NZD' + PLN: "CurrencyCode" = 'PLN' + RUB: "CurrencyCode" = 'RUB' + THB: "CurrencyCode" = 'THB' + TRY: "CurrencyCode" = 'TRY' + TWD: "CurrencyCode" = 'TWD' + UAH: "CurrencyCode" = 'UAH' + ZAR: "CurrencyCode" = 'ZAR' diff --git a/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py b/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py index c57e11c9..c5b6e3fb 100644 --- a/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py +++ b/paddle_billing/Notifications/Entities/Shared/CurrencyCodeAdjustments.py @@ -2,6 +2,6 @@ class CurrencyCodeAdjustments(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - EUR = 'EUR' - GBP = 'GBP' - USD = 'USD' + EUR: "CurrencyCodeAdjustments" = 'EUR' + GBP: "CurrencyCodeAdjustments" = 'GBP' + USD: "CurrencyCodeAdjustments" = 'USD' diff --git a/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py b/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py index 27787954..40eb2284 100644 --- a/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py +++ b/paddle_billing/Notifications/Entities/Shared/CurrencyCodePayouts.py @@ -2,16 +2,16 @@ class CurrencyCodePayouts(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AUD = 'AUD' - CAD = 'CAD' - CHF = 'CHF' - CNY = 'CNY' - CZK = 'CZK' - DKK = 'DKK' - EUR = 'EUR' - GBP = 'GBP' - HUF = 'HUF' - PLN = 'PLN' - SEK = 'SEK' - USD = 'USD' - ZAR = 'ZAR' + AUD: "CurrencyCodePayouts" = 'AUD' + CAD: "CurrencyCodePayouts" = 'CAD' + CHF: "CurrencyCodePayouts" = 'CHF' + CNY: "CurrencyCodePayouts" = 'CNY' + CZK: "CurrencyCodePayouts" = 'CZK' + DKK: "CurrencyCodePayouts" = 'DKK' + EUR: "CurrencyCodePayouts" = 'EUR' + GBP: "CurrencyCodePayouts" = 'GBP' + HUF: "CurrencyCodePayouts" = 'HUF' + PLN: "CurrencyCodePayouts" = 'PLN' + SEK: "CurrencyCodePayouts" = 'SEK' + USD: "CurrencyCodePayouts" = 'USD' + ZAR: "CurrencyCodePayouts" = 'ZAR' diff --git a/paddle_billing/Notifications/Entities/Shared/ErrorCode.py b/paddle_billing/Notifications/Entities/Shared/ErrorCode.py index bf4256df..df517cb1 100644 --- a/paddle_billing/Notifications/Entities/Shared/ErrorCode.py +++ b/paddle_billing/Notifications/Entities/Shared/ErrorCode.py @@ -2,20 +2,20 @@ class ErrorCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AlreadyCanceled = 'already_canceled' - AlreadyRefunded = 'already_refunded' - AuthenticationFailed = 'authentication_failed' - BlockedCard = 'blocked_card' - Canceled = 'canceled' - Declined = 'declined' - ExpiredCard = 'expired_card' - Fraud = 'fraud' - InvalidAmount = 'invalid_amount' - InvalidPaymentDetails = 'invalid_payment_details' - IssuerUnavailable = 'issuer_unavailable' - NotEnoughBalance = 'not_enough_balance' - PspError = 'psp_error' - RedactedPaymentMethod = 'redacted_payment_method' - SystemError = 'system_error' - TransactionNotPermitted = 'transaction_not_permitted' - Unknown = 'unknown' + AlreadyCanceled: "ErrorCode" = 'already_canceled' + AlreadyRefunded: "ErrorCode" = 'already_refunded' + AuthenticationFailed: "ErrorCode" = 'authentication_failed' + BlockedCard: "ErrorCode" = 'blocked_card' + Canceled: "ErrorCode" = 'canceled' + Declined: "ErrorCode" = 'declined' + ExpiredCard: "ErrorCode" = 'expired_card' + Fraud: "ErrorCode" = 'fraud' + InvalidAmount: "ErrorCode" = 'invalid_amount' + InvalidPaymentDetails: "ErrorCode" = 'invalid_payment_details' + IssuerUnavailable: "ErrorCode" = 'issuer_unavailable' + NotEnoughBalance: "ErrorCode" = 'not_enough_balance' + PspError: "ErrorCode" = 'psp_error' + RedactedPaymentMethod: "ErrorCode" = 'redacted_payment_method' + SystemError: "ErrorCode" = 'system_error' + TransactionNotPermitted: "ErrorCode" = 'transaction_not_permitted' + Unknown: "ErrorCode" = 'unknown' diff --git a/paddle_billing/Notifications/Entities/Shared/Interval.py b/paddle_billing/Notifications/Entities/Shared/Interval.py index 3648ea26..4d874f5d 100644 --- a/paddle_billing/Notifications/Entities/Shared/Interval.py +++ b/paddle_billing/Notifications/Entities/Shared/Interval.py @@ -2,7 +2,7 @@ class Interval(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Day = 'day' - Week = 'week' - Month = 'month' - Year = 'year' + Day: "Interval" = 'day' + Week: "Interval" = 'week' + Month: "Interval" = 'month' + Year: "Interval" = 'year' diff --git a/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py b/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py index 6c296b08..84f0d05e 100644 --- a/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py +++ b/paddle_billing/Notifications/Entities/Shared/PaymentAttemptStatus.py @@ -2,12 +2,12 @@ class PaymentAttemptStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Authorized = 'authorized' - AuthorizedFlagged = 'authorized_flagged' - Canceled = 'canceled' - Captured = 'captured' - Error = 'error' - ActionRequired = 'action_required' - PendingNoActionRequired = 'pending_no_action_required' - Created = 'created' - Unknown = 'unknown' + Authorized: "PaymentAttemptStatus" = 'authorized' + AuthorizedFlagged: "PaymentAttemptStatus" = 'authorized_flagged' + Canceled: "PaymentAttemptStatus" = 'canceled' + Captured: "PaymentAttemptStatus" = 'captured' + Error: "PaymentAttemptStatus" = 'error' + ActionRequired: "PaymentAttemptStatus" = 'action_required' + PendingNoActionRequired: "PaymentAttemptStatus" = 'pending_no_action_required' + Created: "PaymentAttemptStatus" = 'created' + Unknown: "PaymentAttemptStatus" = 'unknown' diff --git a/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py b/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py index c6b5b4eb..fa298d60 100644 --- a/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py +++ b/paddle_billing/Notifications/Entities/Shared/PaymentMethodType.py @@ -2,14 +2,14 @@ class PaymentMethodType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Alipay = 'alipay' - ApplePay = 'apple_pay' - Bancontact = 'bancontact' - Card = 'card' - GooglePay = 'google_pay' - Ideal = 'ideal' - Offline = 'offline' - Paypal = 'paypal' - Unknown = 'unknown' - WireTransfer = 'wire_transfer' - Visa = 'visa' + Alipay: "PaymentMethodType" = 'alipay' + ApplePay: "PaymentMethodType" = 'apple_pay' + Bancontact: "PaymentMethodType" = 'bancontact' + Card: "PaymentMethodType" = 'card' + GooglePay: "PaymentMethodType" = 'google_pay' + Ideal: "PaymentMethodType" = 'ideal' + Offline: "PaymentMethodType" = 'offline' + Paypal: "PaymentMethodType" = 'paypal' + Unknown: "PaymentMethodType" = 'unknown' + WireTransfer: "PaymentMethodType" = 'wire_transfer' + Visa: "PaymentMethodType" = 'visa' diff --git a/paddle_billing/Notifications/Entities/Shared/Status.py b/paddle_billing/Notifications/Entities/Shared/Status.py index e86eef94..4ad0dba6 100644 --- a/paddle_billing/Notifications/Entities/Shared/Status.py +++ b/paddle_billing/Notifications/Entities/Shared/Status.py @@ -2,5 +2,5 @@ class Status(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Archived = 'archived' + Active: "Status" = 'active' + Archived: "Status" = 'archived' diff --git a/paddle_billing/Notifications/Entities/Shared/TaxCategory.py b/paddle_billing/Notifications/Entities/Shared/TaxCategory.py index d350d9f7..0663aae5 100644 --- a/paddle_billing/Notifications/Entities/Shared/TaxCategory.py +++ b/paddle_billing/Notifications/Entities/Shared/TaxCategory.py @@ -2,12 +2,12 @@ class TaxCategory(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - DigitalGoods = 'digital-goods' - Ebooks = 'ebooks' - ImplementationServices = 'implementation-services' - ProfessionalServices = 'professional-services' - Saas = 'saas' - SoftwareProgrammingServices = 'software-programming-services' - Standard = 'standard' - TrainingServices = 'training-services' - WebsiteHosting = 'website-hosting' + DigitalGoods: "TaxCategory" = 'digital-goods' + Ebooks: "TaxCategory" = 'ebooks' + ImplementationServices: "TaxCategory" = 'implementation-services' + ProfessionalServices: "TaxCategory" = 'professional-services' + Saas: "TaxCategory" = 'saas' + SoftwareProgrammingServices: "TaxCategory" = 'software-programming-services' + Standard: "TaxCategory" = 'standard' + TrainingServices: "TaxCategory" = 'training-services' + WebsiteHosting: "TaxCategory" = 'website-hosting' diff --git a/paddle_billing/Notifications/Entities/Shared/TaxMode.py b/paddle_billing/Notifications/Entities/Shared/TaxMode.py index 0624829c..b7b54616 100644 --- a/paddle_billing/Notifications/Entities/Shared/TaxMode.py +++ b/paddle_billing/Notifications/Entities/Shared/TaxMode.py @@ -2,6 +2,6 @@ class TaxMode(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AccountSetting = 'account_setting' - External = 'external' - Internal = 'internal' + AccountSetting: "TaxMode" = 'account_setting' + External: "TaxMode" = 'external' + Internal: "TaxMode" = 'internal' diff --git a/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py b/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py index 70e58776..46baa3ec 100644 --- a/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py +++ b/paddle_billing/Notifications/Entities/Shared/TransactionOrigin.py @@ -2,9 +2,9 @@ class TransactionOrigin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Api = 'api' - SubscriptionCharge = 'subscription_charge' - SubscriptionPaymentMethodChange = 'subscription_payment_method_change' - SubscriptionRecurring = 'subscription_recurring' - SubscriptionUpdate = 'subscription_update' - Web = 'web' + Api: "TransactionOrigin" = 'api' + SubscriptionCharge: "TransactionOrigin" = 'subscription_charge' + SubscriptionPaymentMethodChange: "TransactionOrigin" = 'subscription_payment_method_change' + SubscriptionRecurring: "TransactionOrigin" = 'subscription_recurring' + SubscriptionUpdate: "TransactionOrigin" = 'subscription_update' + Web: "TransactionOrigin" = 'web' diff --git a/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py b/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py index 8fd24e74..d2e40378 100644 --- a/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py +++ b/paddle_billing/Notifications/Entities/Shared/TransactionStatus.py @@ -2,10 +2,10 @@ class TransactionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Draft = 'draft' - Ready = 'ready' - Billed = 'billed' - Paid = 'paid' - Completed = 'completed' - Canceled = 'canceled' - PastDue = 'past_due' + Draft: "TransactionStatus" = 'draft' + Ready: "TransactionStatus" = 'ready' + Billed: "TransactionStatus" = 'billed' + Paid: "TransactionStatus" = 'paid' + Completed: "TransactionStatus" = 'completed' + Canceled: "TransactionStatus" = 'canceled' + PastDue: "TransactionStatus" = 'past_due' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py index 14d074dc..88c9f3ca 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py @@ -2,5 +2,5 @@ class SubscriptionEffectiveFrom(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - NextBillingPeriod = 'next_billing_period' - Immediately = 'immediately' + NextBillingPeriod: "SubscriptionEffectiveFrom" = 'next_billing_period' + Immediately: "SubscriptionEffectiveFrom" = 'immediately' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py index e84167c6..de920a8c 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py @@ -2,6 +2,6 @@ class SubscriptionItemStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Inactive = 'inactive' - Trialing = 'trialing' + Active: "SubscriptionItemStatus" = 'active' + Inactive: "SubscriptionItemStatus" = 'inactive' + Trialing: "SubscriptionItemStatus" = 'trialing' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py index fce66853..af2daed6 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionOnPaymentFailure.py @@ -2,5 +2,5 @@ class SubscriptionOnPaymentFailure(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - PreventChange = 'prevent_change' - ApplyChange = 'apply_change' + PreventChange: "SubscriptionOnPaymentFailure" = 'prevent_change' + ApplyChange: "SubscriptionOnPaymentFailure" = 'apply_change' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py index 0617ebaf..576e62e2 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionScheduledChangeAction.py @@ -2,6 +2,6 @@ class SubscriptionScheduledChangeAction(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Cancel = 'cancel' - Pause = 'pause' - Resume = 'resume' + Cancel: "SubscriptionScheduledChangeAction" = 'cancel' + Pause: "SubscriptionScheduledChangeAction" = 'pause' + Resume: "SubscriptionScheduledChangeAction" = 'resume' diff --git a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py index 8da54014..c54e0046 100644 --- a/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py +++ b/paddle_billing/Notifications/Entities/Subscriptions/SubscriptionStatus.py @@ -2,9 +2,9 @@ class SubscriptionStatus(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Active = 'active' - Canceled = 'canceled' - PastDue = 'past_due' - Paused = 'paused' - Trialing = 'trialing' - Inactive = 'inactive' + Active: "SubscriptionStatus" = 'active' + Canceled: "SubscriptionStatus" = 'canceled' + PastDue: "SubscriptionStatus" = 'past_due' + Paused: "SubscriptionStatus" = 'paused' + Trialing: "SubscriptionStatus" = 'trialing' + Inactive: "SubscriptionStatus" = 'inactive' diff --git a/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py b/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py index 99cb0294..039bf339 100644 --- a/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py +++ b/paddle_billing/Notifications/Entities/Transactions/TransactionCardType.py @@ -2,13 +2,13 @@ class TransactionCardType(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - AmericanExpress = 'american_express' - DinersClub = 'diners_club' - Discover = 'discover' - Jcb = 'jcb' - Mada = 'mada' - Maestro = 'maestro' - Mastercard = 'mastercard' - UnionPay = 'union_pay' - Unknown = 'unknown' - Visa = 'visa' + AmericanExpress: "TransactionCardType" = 'american_express' + DinersClub: "TransactionCardType" = 'diners_club' + Discover: "TransactionCardType" = 'discover' + Jcb: "TransactionCardType" = 'jcb' + Mada: "TransactionCardType" = 'mada' + Maestro: "TransactionCardType" = 'maestro' + Mastercard: "TransactionCardType" = 'mastercard' + UnionPay: "TransactionCardType" = 'union_pay' + Unknown: "TransactionCardType" = 'unknown' + Visa: "TransactionCardType" = 'visa' diff --git a/paddle_billing/Resources/Prices/Operations/List/Includes.py b/paddle_billing/Resources/Prices/Operations/List/Includes.py index 47a8550f..993952e6 100644 --- a/paddle_billing/Resources/Prices/Operations/List/Includes.py +++ b/paddle_billing/Resources/Prices/Operations/List/Includes.py @@ -2,4 +2,4 @@ class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Product = 'product' + Product: "Includes" = 'product' diff --git a/paddle_billing/Resources/Products/Operations/List/Includes.py b/paddle_billing/Resources/Products/Operations/List/Includes.py index d99d5bf7..3c871630 100644 --- a/paddle_billing/Resources/Products/Operations/List/Includes.py +++ b/paddle_billing/Resources/Products/Operations/List/Includes.py @@ -2,4 +2,4 @@ class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Prices = 'prices' + Prices: "Includes" = 'prices' diff --git a/paddle_billing/Resources/Shared/Operations/List/Comparator.py b/paddle_billing/Resources/Shared/Operations/List/Comparator.py index ef6de16f..69413ec5 100644 --- a/paddle_billing/Resources/Shared/Operations/List/Comparator.py +++ b/paddle_billing/Resources/Shared/Operations/List/Comparator.py @@ -2,7 +2,7 @@ class Comparator(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - LT = 'LT' - LTE = 'LTE' - GT = 'GT' - GTE = 'GTE' + LT: "Comparator" = 'LT' + LTE: "Comparator" = 'LTE' + GT: "Comparator" = 'GT' + GTE: "Comparator" = 'GTE' diff --git a/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py b/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py index 5ced758b..c4f61aa8 100644 --- a/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py +++ b/paddle_billing/Resources/Subscriptions/Operations/Get/Includes.py @@ -2,5 +2,5 @@ class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - NextTransaction = 'next_transaction' - RecurringTransactionDetails = 'recurring_transaction_details' + NextTransaction: "Includes" = 'next_transaction' + RecurringTransactionDetails: "Includes" = 'recurring_transaction_details' diff --git a/paddle_billing/Resources/Transactions/Operations/List/Includes.py b/paddle_billing/Resources/Transactions/Operations/List/Includes.py index 88e6e45f..5e09eb0f 100644 --- a/paddle_billing/Resources/Transactions/Operations/List/Includes.py +++ b/paddle_billing/Resources/Transactions/Operations/List/Includes.py @@ -2,10 +2,10 @@ class Includes(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Address = 'address' - Adjustment = 'adjustment' - AdjustmentsTotals = 'adjustments_totals' - AvailablePaymentMethods = 'available_payment_methods' - Business = 'business' - Customer = 'customer' - Discount = 'discount' + Address: "Includes" = 'address' + Adjustment: "Includes" = 'adjustment' + AdjustmentsTotals: "Includes" = 'adjustments_totals' + AvailablePaymentMethods: "Includes" = 'available_payment_methods' + Business: "Includes" = 'business' + Customer: "Includes" = 'customer' + Discount: "Includes" = 'discount' diff --git a/paddle_billing/Resources/Transactions/Operations/List/Origin.py b/paddle_billing/Resources/Transactions/Operations/List/Origin.py index 29e72f19..8db8e9d9 100644 --- a/paddle_billing/Resources/Transactions/Operations/List/Origin.py +++ b/paddle_billing/Resources/Transactions/Operations/List/Origin.py @@ -2,9 +2,9 @@ class Origin(PaddleStrEnum, metaclass=PaddleStrEnumMeta): - Api = 'api' - SubscriptionCharge = 'subscription_charge' - SubscriptionPaymentMethodChange = 'subscription_payment_method_change' - SubscriptionRecurring = 'subscription_recurring' - SubscriptionUpdate = 'subscription_update' - Web = 'web' + Api: "Origin" = 'api' + SubscriptionCharge: "Origin" = 'subscription_charge' + SubscriptionPaymentMethodChange: "Origin" = 'subscription_payment_method_change' + SubscriptionRecurring: "Origin" = 'subscription_recurring' + SubscriptionUpdate: "Origin" = 'subscription_update' + Web: "Origin" = 'web'