|
5 | 5 | from braintree.dispute_details import DisputeEvidence, DisputeStatusHistory, DisputePayPalMessage
|
6 | 6 | from braintree.configuration import Configuration
|
7 | 7 |
|
8 |
| -class Dispute(AttributeGetter): |
| 8 | + |
| 9 | +class _DisputeType(type): |
| 10 | + @property |
| 11 | + def ChargebackProtectionLevel(cls): |
| 12 | + warnings.warn("Use ProtectionLevel enum instead", DeprecationWarning) |
| 13 | + return cls._ChargebackProtectionLevel |
| 14 | + |
| 15 | + |
| 16 | +class Dispute(AttributeGetter, metaclass=_DisputeType): |
9 | 17 | # NEXT_MAJOR_VERSION this can be an enum! they were added as of python 3.4 and we support 3.5+
|
10 | 18 | class Status(object):
|
11 | 19 | """
|
@@ -72,19 +80,22 @@ class Kind(object):
|
72 | 80 | Retrieval = "retrieval"
|
73 | 81 |
|
74 | 82 | # NEXT_MAJOR_VERSION Remove this enum
|
75 |
| - class ChargebackProtectionLevel(object): |
| 83 | + class _ChargebackProtectionLevel(object): |
76 | 84 | """
|
77 | 85 | Constants representing dispute ChargebackProtectionLevel. Available types are:
|
78 | 86 |
|
79 | 87 | * braintree.Dispute.ChargebackProtectionLevel.EFFORTLESS
|
80 | 88 | * braintree.Dispute.ChargebackProtectionLevel.STANDARD
|
81 | 89 | * braintree.Dispute.ChargebackProtectionLevel.NOT_PROTECTED
|
82 | 90 | """
|
83 |
| - warnings.warn("Use ProtectionLevel enum instead", DeprecationWarning) |
84 | 91 | Effortless = "effortless"
|
85 | 92 | Standard = "standard"
|
86 | 93 | NotProtected = "not_protected"
|
87 | 94 |
|
| 95 | + @property |
| 96 | + def ChargebackProtectionLevel(self): |
| 97 | + return self.__class__.ChargebackProtectionLevel |
| 98 | + |
88 | 99 | # NEXT_MAJOR_VERSION this can be an enum! they were added as of python 3.4 and we support 3.5+
|
89 | 100 | class PreDisputeProgram(object):
|
90 | 101 | """
|
|
0 commit comments