Source code for worldline.connect.sdk.v1.domain.amount_of_money
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://apireference.connect.worldline-solutions.com/
#
from typing import Optional
from worldline.connect.sdk.domain.data_object import DataObject
[docs]
class AmountOfMoney(DataObject):
__amount: Optional[int] = None
__currency_code: Optional[str] = None
@property
def amount(self) -> Optional[int]:
"""
| Amount in cents and always having 2 decimals
Type: int
"""
return self.__amount
@amount.setter
def amount(self, value: Optional[int]) -> None:
self.__amount = value
@property
def currency_code(self) -> Optional[str]:
"""
| Three-letter ISO currency code representing the currency for the amount
Type: str
"""
return self.__currency_code
@currency_code.setter
def currency_code(self, value: Optional[str]) -> None:
self.__currency_code = value
[docs]
def to_dictionary(self) -> dict:
dictionary = super(AmountOfMoney, self).to_dictionary()
if self.amount is not None:
dictionary['amount'] = self.amount
if self.currency_code is not None:
dictionary['currencyCode'] = self.currency_code
return dictionary
[docs]
def from_dictionary(self, dictionary: dict) -> 'AmountOfMoney':
super(AmountOfMoney, self).from_dictionary(dictionary)
if 'amount' in dictionary:
self.amount = dictionary['amount']
if 'currencyCode' in dictionary:
self.currency_code = dictionary['currencyCode']
return self