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 worldline.connect.sdk.domain.data_object import DataObject


[docs]class AmountOfMoney(DataObject): __amount = None __currency_code = None @property def amount(self): """ | Amount in cents and always having 2 decimals Type: long """ return self.__amount @amount.setter def amount(self, value): self.__amount = value @property def currency_code(self): """ | 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): self.__currency_code = value
[docs] def to_dictionary(self): 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): 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