# Path: ingenico/connect/sdk/domain/definitions/amount_of_money.py
# class AmountOfMoney(DataObject):
# 
#     __amount = None
#     __currency_code = None
# 
#     @property
#     def amount(self):
#         """
#         | Amount in cents and always having 2 decimals
#         
#         Type: int
#         """
#         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
# 
#     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
# 
#     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


from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney
        """
        | The number of installments in which this transaction will be paid, which can be used for card payments. Only used with some acquirers. In case you send in the details of this object, only the combination of card products and acquirers that do support installments will be shown on the MyCheckout hosted payment pages.If this property is not provided the customer will not see details on the installment plan in a HostedCheckout.
        
        Type: int
        """
        return self.__number_of_installments

    @number_of_installments.setter
    def number_of_installments(self, value):
        self.__number_of_installments = value

    def to_dictionary(self):
        dictionary = super(Installments, self).to_dictionary()
        if self.amount_of_money_per_installment is not None:
            dictionary['amountOfMoneyPerInstallment'] = self.amount_of_money_per_installment.to_dictionary()
        if self.frequency_of_installments is not None:
            dictionary['frequencyOfInstallments'] = self.frequency_of_installments
        if self.installment_plan_code is not None:
            dictionary['installmentPlanCode'] = self.installment_plan_code
        if self.interest_rate is not None:
            dictionary['interestRate'] = self.interest_rate
        if self.number_of_installments is not None:
            dictionary['numberOfInstallments'] = self.number_of_installments
        return dictionary

    def from_dictionary(self, dictionary):
        super(Installments, self).from_dictionary(dictionary)
        if 'amountOfMoneyPerInstallment' in dictionary:
            if not isinstance(dictionary['amountOfMoneyPerInstallment'], dict):
                raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['amountOfMoneyPerInstallment']))

# Path: ingenico/connect/sdk/domain/definitions/amount_of_money.py
# class AmountOfMoney(DataObject):
# 
#     __amount = None
#     __currency_code = None
# 
#     @property
#     def amount(self):
#         """
#         | Amount in cents and always having 2 decimals
#         
#         Type: int
#         """
#         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
# 
#     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
# 
#     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


# Path: ingenico/connect/sdk/domain/payment/definitions/installments.py
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney

        """
        | The number of installments in which this transaction will be paid, which can be used for card payments. Only used with some acquirers. In case you send in the details of this object, only the combination of card products and acquirers that do support installments will be shown on the MyCheckout hosted payment pages.If this property is not provided the customer will not see details on the installment plan in a HostedCheckout.
        
        Type: int
        """
        return self.__number_of_installments

    @number_of_installments.setter
    def number_of_installments(self, value):
        self.__number_of_installments = value

    def to_dictionary(self):
        dictionary = super(Installments, self).to_dictionary()
        if self.amount_of_money_per_installment is not None:
            dictionary['amountOfMoneyPerInstallment'] = self.amount_of_money_per_installment.to_dictionary()
        if self.frequency_of_installments is not None:
            dictionary['frequencyOfInstallments'] = self.frequency_of_installments
        if self.installment_plan_code is not None:
            dictionary['installmentPlanCode'] = self.installment_plan_code
        if self.interest_rate is not None:
            dictionary['interestRate'] = self.interest_rate
        if self.number_of_installments is not None:
            dictionary['numberOfInstallments'] = self.number_of_installments
        return dictionary

    def from_dictionary(self, dictionary):
        super(Installments, self).from_dictionary(dictionary)
        if 'amountOfMoneyPerInstallment' in dictionary:
            if not isinstance(dictionary['amountOfMoneyPerInstallment'], dict):
                raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['amountOfMoneyPerInstallment']))

            value = AmountOfMoney()