Money
An amount in minor units (cents) and an uppercase ISO 4217 currency.
Class in sponsorkit.models.
from sponsorkit import MoneyAlso importable from sponsorkit.models.
@dataclass(frozen=True)
class Money:
...An amount in minor units (cents) and an uppercase ISO 4217 currency.
Constructor#
Money(value: int, currency: str) -> NoneInstances are immutable; every field below is a constructor parameter.
Fields#
value#
value: intAmount in minor units (cents).
currency#
currency: strUppercase ISO 4217 code, e.g. USD.
Methods#
from_dict()#
@classmethod
def from_dict(cls, d: Mapping[str, Any]) -> MoneyParse the JSON form.
to_dict()#
def to_dict(self) -> dict[str, Any]The JSON form.