# **********************************************************************
#
# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************
#
# Ice version 3.6.2
#
# <auto-generated>
#
# Generated from file `assignment2.ice'
#
# Warning: do not edit this file.
#
# </auto-generated>
#

import Ice, IcePy

# Start of module assignment2
_M_assignment2 = Ice.openModule('assignment2')
__name__ = 'assignment2'

if 'Currency' not in _M_assignment2.__dict__:
    _M_assignment2.Currency = Ice.createTempClass()
    class Currency(Ice.EnumBase):

        def __init__(self, _n, _v):
            Ice.EnumBase.__init__(self, _n, _v)

        def valueOf(self, _n):
            if _n in self._enumerators:
                return self._enumerators[_n]
            return None
        valueOf = classmethod(valueOf)

    Currency.EUR = Currency("EUR", 0)
    Currency.USD = Currency("USD", 1)
    Currency.CHF = Currency("CHF", 2)
    Currency._enumerators = { 0:Currency.EUR, 1:Currency.USD, 2:Currency.CHF }

    _M_assignment2._t_Currency = IcePy.defineEnum('::assignment2::Currency', Currency, (), Currency._enumerators)

    _M_assignment2.Currency = Currency
    del Currency

if 'UserNotLoggedException' not in _M_assignment2.__dict__:
    _M_assignment2.UserNotLoggedException = Ice.createTempClass()
    class UserNotLoggedException(Ice.UserException):
        def __init__(self):
            pass

        def __str__(self):
            return IcePy.stringifyException(self)

        __repr__ = __str__

        _ice_name = 'assignment2::UserNotLoggedException'

    _M_assignment2._t_UserNotLoggedException = IcePy.defineException('::assignment2::UserNotLoggedException', UserNotLoggedException, (), False, None, ())
    UserNotLoggedException._ice_type = _M_assignment2._t_UserNotLoggedException

    _M_assignment2.UserNotLoggedException = UserNotLoggedException
    del UserNotLoggedException

if 'Loan' not in _M_assignment2.__dict__:
    _M_assignment2.Loan = Ice.createTempClass()
    class Loan(object):
        def __init__(self, interest='', paid='', toPay='', monthsLeft=0):
            self.interest = interest
            self.paid = paid
            self.toPay = toPay
            self.monthsLeft = monthsLeft

        def __hash__(self):
            _h = 0
            _h = 5 * _h + Ice.getHash(self.interest)
            _h = 5 * _h + Ice.getHash(self.paid)
            _h = 5 * _h + Ice.getHash(self.toPay)
            _h = 5 * _h + Ice.getHash(self.monthsLeft)
            return _h % 0x7fffffff

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_assignment2.Loan):
                return NotImplemented
            else:
                if self.interest is None or other.interest is None:
                    if self.interest != other.interest:
                        return (-1 if self.interest is None else 1)
                else:
                    if self.interest < other.interest:
                        return -1
                    elif self.interest > other.interest:
                        return 1
                if self.paid is None or other.paid is None:
                    if self.paid != other.paid:
                        return (-1 if self.paid is None else 1)
                else:
                    if self.paid < other.paid:
                        return -1
                    elif self.paid > other.paid:
                        return 1
                if self.toPay is None or other.toPay is None:
                    if self.toPay != other.toPay:
                        return (-1 if self.toPay is None else 1)
                else:
                    if self.toPay < other.toPay:
                        return -1
                    elif self.toPay > other.toPay:
                        return 1
                if self.monthsLeft is None or other.monthsLeft is None:
                    if self.monthsLeft != other.monthsLeft:
                        return (-1 if self.monthsLeft is None else 1)
                else:
                    if self.monthsLeft < other.monthsLeft:
                        return -1
                    elif self.monthsLeft > other.monthsLeft:
                        return 1
                return 0

        def __lt__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r < 0

        def __le__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r <= 0

        def __gt__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r > 0

        def __ge__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r >= 0

        def __eq__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r == 0

        def __ne__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r != 0

        def __str__(self):
            return IcePy.stringify(self, _M_assignment2._t_Loan)

        __repr__ = __str__

    _M_assignment2._t_Loan = IcePy.defineStruct('::assignment2::Loan', Loan, (), (
        ('interest', (), IcePy._t_string),
        ('paid', (), IcePy._t_string),
        ('toPay', (), IcePy._t_string),
        ('monthsLeft', (), IcePy._t_int)
    ))

    _M_assignment2.Loan = Loan
    del Loan

if 'Investment' not in _M_assignment2.__dict__:
    _M_assignment2.Investment = Ice.createTempClass()
    class Investment(object):
        def __init__(self, interest='', moneyProvided='', moneyEarned='', monthsLeft=0):
            self.interest = interest
            self.moneyProvided = moneyProvided
            self.moneyEarned = moneyEarned
            self.monthsLeft = monthsLeft

        def __hash__(self):
            _h = 0
            _h = 5 * _h + Ice.getHash(self.interest)
            _h = 5 * _h + Ice.getHash(self.moneyProvided)
            _h = 5 * _h + Ice.getHash(self.moneyEarned)
            _h = 5 * _h + Ice.getHash(self.monthsLeft)
            return _h % 0x7fffffff

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_assignment2.Investment):
                return NotImplemented
            else:
                if self.interest is None or other.interest is None:
                    if self.interest != other.interest:
                        return (-1 if self.interest is None else 1)
                else:
                    if self.interest < other.interest:
                        return -1
                    elif self.interest > other.interest:
                        return 1
                if self.moneyProvided is None or other.moneyProvided is None:
                    if self.moneyProvided != other.moneyProvided:
                        return (-1 if self.moneyProvided is None else 1)
                else:
                    if self.moneyProvided < other.moneyProvided:
                        return -1
                    elif self.moneyProvided > other.moneyProvided:
                        return 1
                if self.moneyEarned is None or other.moneyEarned is None:
                    if self.moneyEarned != other.moneyEarned:
                        return (-1 if self.moneyEarned is None else 1)
                else:
                    if self.moneyEarned < other.moneyEarned:
                        return -1
                    elif self.moneyEarned > other.moneyEarned:
                        return 1
                if self.monthsLeft is None or other.monthsLeft is None:
                    if self.monthsLeft != other.monthsLeft:
                        return (-1 if self.monthsLeft is None else 1)
                else:
                    if self.monthsLeft < other.monthsLeft:
                        return -1
                    elif self.monthsLeft > other.monthsLeft:
                        return 1
                return 0

        def __lt__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r < 0

        def __le__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r <= 0

        def __gt__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r > 0

        def __ge__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r >= 0

        def __eq__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r == 0

        def __ne__(self, other):
            r = self.__compare(other)
            if r is NotImplemented:
                return r
            else:
                return r != 0

        def __str__(self):
            return IcePy.stringify(self, _M_assignment2._t_Investment)

        __repr__ = __str__

    _M_assignment2._t_Investment = IcePy.defineStruct('::assignment2::Investment', Investment, (), (
        ('interest', (), IcePy._t_string),
        ('moneyProvided', (), IcePy._t_string),
        ('moneyEarned', (), IcePy._t_string),
        ('monthsLeft', (), IcePy._t_int)
    ))

    _M_assignment2.Investment = Investment
    del Investment

if '_t_loans' not in _M_assignment2.__dict__:
    _M_assignment2._t_loans = IcePy.defineSequence('::assignment2::loans', (), _M_assignment2._t_Loan)

if '_t_investments' not in _M_assignment2.__dict__:
    _M_assignment2._t_investments = IcePy.defineSequence('::assignment2::investments', (), _M_assignment2._t_Investment)

if 'Customer' not in _M_assignment2.__dict__:
    _M_assignment2.Customer = Ice.createTempClass()
    class Customer(Ice.Object):
        def __init__(self):
            if Ice.getType(self) == _M_assignment2.Customer:
                raise RuntimeError('assignment2.Customer is an abstract class')

        def ice_ids(self, current=None):
            return ('::Ice::Object', '::assignment2::Customer')

        def ice_id(self, current=None):
            return '::assignment2::Customer'

        def ice_staticId():
            return '::assignment2::Customer'
        ice_staticId = staticmethod(ice_staticId)

        def login(self, current=None):
            pass

        def logout(self, current=None):
            pass

        def calcInvestmentInterest(self, periodInMonths, amount, currency, current=None):
            pass

        def calcLoadInterest(self, periodInMoths, amount, currency, current=None):
            pass

        def getLoans(self, current=None):
            pass

        def getInvestments(self, current=None):
            pass

        def __str__(self):
            return IcePy.stringify(self, _M_assignment2._t_Customer)

        __repr__ = __str__

    _M_assignment2.CustomerPrx = Ice.createTempClass()
    class CustomerPrx(Ice.ObjectPrx):

        def login(self, _ctx=None):
            return _M_assignment2.Customer._op_login.invoke(self, ((), _ctx))

        def begin_login(self, _response=None, _ex=None, _sent=None, _ctx=None):
            return _M_assignment2.Customer._op_login.begin(self, ((), _response, _ex, _sent, _ctx))

        def end_login(self, _r):
            return _M_assignment2.Customer._op_login.end(self, _r)

        def logout(self, _ctx=None):
            return _M_assignment2.Customer._op_logout.invoke(self, ((), _ctx))

        def begin_logout(self, _response=None, _ex=None, _sent=None, _ctx=None):
            return _M_assignment2.Customer._op_logout.begin(self, ((), _response, _ex, _sent, _ctx))

        def end_logout(self, _r):
            return _M_assignment2.Customer._op_logout.end(self, _r)

        def calcInvestmentInterest(self, periodInMonths, amount, currency, _ctx=None):
            return _M_assignment2.Customer._op_calcInvestmentInterest.invoke(self, ((periodInMonths, amount, currency), _ctx))

        def begin_calcInvestmentInterest(self, periodInMonths, amount, currency, _response=None, _ex=None, _sent=None, _ctx=None):
            return _M_assignment2.Customer._op_calcInvestmentInterest.begin(self, ((periodInMonths, amount, currency), _response, _ex, _sent, _ctx))

        def end_calcInvestmentInterest(self, _r):
            return _M_assignment2.Customer._op_calcInvestmentInterest.end(self, _r)

        def calcLoadInterest(self, periodInMoths, amount, currency, _ctx=None):
            return _M_assignment2.Customer._op_calcLoadInterest.invoke(self, ((periodInMoths, amount, currency), _ctx))

        def begin_calcLoadInterest(self, periodInMoths, amount, currency, _response=None, _ex=None, _sent=None, _ctx=None):
            return _M_assignment2.Customer._op_calcLoadInterest.begin(self, ((periodInMoths, amount, currency), _response, _ex, _sent, _ctx))

        def end_calcLoadInterest(self, _r):
            return _M_assignment2.Customer._op_calcLoadInterest.end(self, _r)

        def getLoans(self, _ctx=None):
            return _M_assignment2.Customer._op_getLoans.invoke(self, ((), _ctx))

        def begin_getLoans(self, _response=None, _ex=None, _sent=None, _ctx=None):
            return _M_assignment2.Customer._op_getLoans.begin(self, ((), _response, _ex, _sent, _ctx))

        def end_getLoans(self, _r):
            return _M_assignment2.Customer._op_getLoans.end(self, _r)

        def getInvestments(self, _ctx=None):
            return _M_assignment2.Customer._op_getInvestments.invoke(self, ((), _ctx))

        def begin_getInvestments(self, _response=None, _ex=None, _sent=None, _ctx=None):
            return _M_assignment2.Customer._op_getInvestments.begin(self, ((), _response, _ex, _sent, _ctx))

        def end_getInvestments(self, _r):
            return _M_assignment2.Customer._op_getInvestments.end(self, _r)

        def checkedCast(proxy, facetOrCtx=None, _ctx=None):
            return _M_assignment2.CustomerPrx.ice_checkedCast(proxy, '::assignment2::Customer', facetOrCtx, _ctx)
        checkedCast = staticmethod(checkedCast)

        def uncheckedCast(proxy, facet=None):
            return _M_assignment2.CustomerPrx.ice_uncheckedCast(proxy, facet)
        uncheckedCast = staticmethod(uncheckedCast)

        def ice_staticId():
            return '::assignment2::Customer'
        ice_staticId = staticmethod(ice_staticId)

    _M_assignment2._t_CustomerPrx = IcePy.defineProxy('::assignment2::Customer', CustomerPrx)

    _M_assignment2._t_Customer = IcePy.defineClass('::assignment2::Customer', Customer, -1, (), True, False, None, (), ())
    Customer._ice_type = _M_assignment2._t_Customer

    Customer._op_login = IcePy.Operation('login', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (), (), None, ())
    Customer._op_logout = IcePy.Operation('logout', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (), (), None, ())
    Customer._op_calcInvestmentInterest = IcePy.Operation('calcInvestmentInterest', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), IcePy._t_int, False, 0), ((), IcePy._t_int, False, 0), ((), _M_assignment2._t_Currency, False, 0)), (), ((), IcePy._t_string, False, 0), (_M_assignment2._t_UserNotLoggedException,))
    Customer._op_calcLoadInterest = IcePy.Operation('calcLoadInterest', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), IcePy._t_int, False, 0), ((), IcePy._t_int, False, 0), ((), _M_assignment2._t_Currency, False, 0)), (), ((), IcePy._t_string, False, 0), (_M_assignment2._t_UserNotLoggedException,))
    Customer._op_getLoans = IcePy.Operation('getLoans', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (), (), ((), _M_assignment2._t_loans, False, 0), (_M_assignment2._t_UserNotLoggedException,))
    Customer._op_getInvestments = IcePy.Operation('getInvestments', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (), (), ((), _M_assignment2._t_investments, False, 0), (_M_assignment2._t_UserNotLoggedException,))

    _M_assignment2.Customer = Customer
    del Customer

    _M_assignment2.CustomerPrx = CustomerPrx
    del CustomerPrx

# End of module assignment2
