# -*- coding: utf-8 -*-
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
#
# Ice version 3.7.2
#
# <auto-generated>
#
# Generated from file `bank.ice'
#
# Warning: do not edit this file.
#
# </auto-generated>
#

from sys import version_info as _version_info_
import Ice, IcePy

# Start of module Banks
_M_Banks = Ice.openModule('Banks')
__name__ = 'Banks'

if 'Currency' not in _M_Banks.__dict__:
    _M_Banks.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.GBP = Currency("GBP", 3)
    Currency.JPY = Currency("JPY", 4)
    Currency.PLN = Currency("PLN", 5)
    Currency._enumerators = { 0:Currency.EUR, 1:Currency.USD, 2:Currency.CHF, 3:Currency.GBP, 4:Currency.JPY, 5:Currency.PLN }

    _M_Banks._t_Currency = IcePy.defineEnum('::Banks::Currency', Currency, (), Currency._enumerators)

    _M_Banks.Currency = Currency
    del Currency

_M_Banks.localCurrency = _M_Banks.Currency.PLN

if 'AccountType' not in _M_Banks.__dict__:
    _M_Banks.AccountType = Ice.createTempClass()
    class AccountType(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)

    AccountType.STANDARD = AccountType("STANDARD", 0)
    AccountType.PREMIUM = AccountType("PREMIUM", 1)
    AccountType._enumerators = { 0:AccountType.STANDARD, 1:AccountType.PREMIUM }

    _M_Banks._t_AccountType = IcePy.defineEnum('::Banks::AccountType', AccountType, (), AccountType._enumerators)

    _M_Banks.AccountType = AccountType
    del AccountType

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

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

        __repr__ = __str__

        _ice_id = '::Banks::ErrorLoan'

    _M_Banks._t_ErrorLoan = IcePy.defineException('::Banks::ErrorLoan', ErrorLoan, (), False, None, ())
    ErrorLoan._ice_type = _M_Banks._t_ErrorLoan

    _M_Banks.ErrorLoan = ErrorLoan
    del ErrorLoan

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

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

        __repr__ = __str__

        _ice_id = '::Banks::ErrorNewUser'

    _M_Banks._t_ErrorNewUser = IcePy.defineException('::Banks::ErrorNewUser', ErrorNewUser, (), False, None, ())
    ErrorNewUser._ice_type = _M_Banks._t_ErrorNewUser

    _M_Banks.ErrorNewUser = ErrorNewUser
    del ErrorNewUser

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

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

        __repr__ = __str__

        _ice_id = '::Banks::ErrorConnectUser'

    _M_Banks._t_ErrorConnectUser = IcePy.defineException('::Banks::ErrorConnectUser', ErrorConnectUser, (), False, None, ())
    ErrorConnectUser._ice_type = _M_Banks._t_ErrorConnectUser

    _M_Banks.ErrorConnectUser = ErrorConnectUser
    del ErrorConnectUser

if 'DualCurrency' not in _M_Banks.__dict__:
    _M_Banks.DualCurrency = Ice.createTempClass()
    class DualCurrency(object):
        def __init__(self, globalCurrency=_M_Banks.Currency.EUR, globalCurrencyValue=0, localCurrencyValue=0):
            self.globalCurrency = globalCurrency
            self.globalCurrencyValue = globalCurrencyValue
            self.localCurrencyValue = localCurrencyValue

        def __hash__(self):
            _h = 0
            _h = 5 * _h + Ice.getHash(self.globalCurrency)
            _h = 5 * _h + Ice.getHash(self.globalCurrencyValue)
            _h = 5 * _h + Ice.getHash(self.localCurrencyValue)
            return _h % 0x7fffffff

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_Banks.DualCurrency):
                return NotImplemented
            else:
                if self.globalCurrency is None or other.globalCurrency is None:
                    if self.globalCurrency != other.globalCurrency:
                        return (-1 if self.globalCurrency is None else 1)
                else:
                    if self.globalCurrency < other.globalCurrency:
                        return -1
                    elif self.globalCurrency > other.globalCurrency:
                        return 1
                if self.globalCurrencyValue is None or other.globalCurrencyValue is None:
                    if self.globalCurrencyValue != other.globalCurrencyValue:
                        return (-1 if self.globalCurrencyValue is None else 1)
                else:
                    if self.globalCurrencyValue < other.globalCurrencyValue:
                        return -1
                    elif self.globalCurrencyValue > other.globalCurrencyValue:
                        return 1
                if self.localCurrencyValue is None or other.localCurrencyValue is None:
                    if self.localCurrencyValue != other.localCurrencyValue:
                        return (-1 if self.localCurrencyValue is None else 1)
                else:
                    if self.localCurrencyValue < other.localCurrencyValue:
                        return -1
                    elif self.localCurrencyValue > other.localCurrencyValue:
                        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_Banks._t_DualCurrency)

        __repr__ = __str__

    _M_Banks._t_DualCurrency = IcePy.defineStruct('::Banks::DualCurrency', DualCurrency, (), (
        ('globalCurrency', (), _M_Banks._t_Currency),
        ('globalCurrencyValue', (), IcePy._t_int),
        ('localCurrencyValue', (), IcePy._t_int)
    ))

    _M_Banks.DualCurrency = DualCurrency
    del DualCurrency

if 'NewAccountDetails' not in _M_Banks.__dict__:
    _M_Banks.NewAccountDetails = Ice.createTempClass()
    class NewAccountDetails(object):
        def __init__(self, accountType=_M_Banks.AccountType.STANDARD, key=''):
            self.accountType = accountType
            self.key = key

        def __hash__(self):
            _h = 0
            _h = 5 * _h + Ice.getHash(self.accountType)
            _h = 5 * _h + Ice.getHash(self.key)
            return _h % 0x7fffffff

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_Banks.NewAccountDetails):
                return NotImplemented
            else:
                if self.accountType is None or other.accountType is None:
                    if self.accountType != other.accountType:
                        return (-1 if self.accountType is None else 1)
                else:
                    if self.accountType < other.accountType:
                        return -1
                    elif self.accountType > other.accountType:
                        return 1
                if self.key is None or other.key is None:
                    if self.key != other.key:
                        return (-1 if self.key is None else 1)
                else:
                    if self.key < other.key:
                        return -1
                    elif self.key > other.key:
                        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_Banks._t_NewAccountDetails)

        __repr__ = __str__

    _M_Banks._t_NewAccountDetails = IcePy.defineStruct('::Banks::NewAccountDetails', NewAccountDetails, (), (
        ('accountType', (), _M_Banks._t_AccountType),
        ('key', (), IcePy._t_string)
    ))

    _M_Banks.NewAccountDetails = NewAccountDetails
    del NewAccountDetails

_M_Banks._t_Account = IcePy.defineValue('::Banks::Account', Ice.Value, -1, (), False, True, None, ())

if 'AccountPrx' not in _M_Banks.__dict__:
    _M_Banks.AccountPrx = Ice.createTempClass()
    class AccountPrx(Ice.ObjectPrx):

        def getLoan(self, currency, amount, time, context=None):
            return _M_Banks.Account._op_getLoan.invoke(self, ((currency, amount, time), context))

        def getLoanAsync(self, currency, amount, time, context=None):
            return _M_Banks.Account._op_getLoan.invokeAsync(self, ((currency, amount, time), context))

        def begin_getLoan(self, currency, amount, time, _response=None, _ex=None, _sent=None, context=None):
            return _M_Banks.Account._op_getLoan.begin(self, ((currency, amount, time), _response, _ex, _sent, context))

        def end_getLoan(self, _r):
            return _M_Banks.Account._op_getLoan.end(self, _r)

        def getStatus(self, context=None):
            return _M_Banks.Account._op_getStatus.invoke(self, ((), context))

        def getStatusAsync(self, context=None):
            return _M_Banks.Account._op_getStatus.invokeAsync(self, ((), context))

        def begin_getStatus(self, _response=None, _ex=None, _sent=None, context=None):
            return _M_Banks.Account._op_getStatus.begin(self, ((), _response, _ex, _sent, context))

        def end_getStatus(self, _r):
            return _M_Banks.Account._op_getStatus.end(self, _r)

        def getKey(self, context=None):
            return _M_Banks.Account._op_getKey.invoke(self, ((), context))

        def getKeyAsync(self, context=None):
            return _M_Banks.Account._op_getKey.invokeAsync(self, ((), context))

        def begin_getKey(self, _response=None, _ex=None, _sent=None, context=None):
            return _M_Banks.Account._op_getKey.begin(self, ((), _response, _ex, _sent, context))

        def end_getKey(self, _r):
            return _M_Banks.Account._op_getKey.end(self, _r)

        @staticmethod
        def checkedCast(proxy, facetOrContext=None, context=None):
            return _M_Banks.AccountPrx.ice_checkedCast(proxy, '::Banks::Account', facetOrContext, context)

        @staticmethod
        def uncheckedCast(proxy, facet=None):
            return _M_Banks.AccountPrx.ice_uncheckedCast(proxy, facet)

        @staticmethod
        def ice_staticId():
            return '::Banks::Account'
    _M_Banks._t_AccountPrx = IcePy.defineProxy('::Banks::Account', AccountPrx)

    _M_Banks.AccountPrx = AccountPrx
    del AccountPrx

    _M_Banks.Account = Ice.createTempClass()
    class Account(Ice.Object):

        def ice_ids(self, current=None):
            return ('::Banks::Account', '::Ice::Object')

        def ice_id(self, current=None):
            return '::Banks::Account'

        @staticmethod
        def ice_staticId():
            return '::Banks::Account'

        def getLoan(self, currency, amount, time, current=None):
            raise NotImplementedError("servant method 'getLoan' not implemented")

        def getStatus(self, current=None):
            raise NotImplementedError("servant method 'getStatus' not implemented")

        def getKey(self, current=None):
            raise NotImplementedError("servant method 'getKey' not implemented")

        def __str__(self):
            return IcePy.stringify(self, _M_Banks._t_AccountDisp)

        __repr__ = __str__

    _M_Banks._t_AccountDisp = IcePy.defineClass('::Banks::Account', Account, (), None, ())
    Account._ice_type = _M_Banks._t_AccountDisp

    Account._op_getLoan = IcePy.Operation('getLoan', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), _M_Banks._t_Currency, False, 0), ((), IcePy._t_int, False, 0), ((), IcePy._t_int, False, 0)), (), ((), _M_Banks._t_DualCurrency, False, 0), (_M_Banks._t_ErrorLoan,))
    Account._op_getStatus = IcePy.Operation('getStatus', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (), (), ((), IcePy._t_int, False, 0), ())
    Account._op_getKey = IcePy.Operation('getKey', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (), (), ((), IcePy._t_string, False, 0), ())

    _M_Banks.Account = Account
    del Account

_M_Banks._t_AccountPremium = IcePy.defineValue('::Banks::AccountPremium', Ice.Value, -1, (), False, True, None, ())

if 'AccountPremiumPrx' not in _M_Banks.__dict__:
    _M_Banks.AccountPremiumPrx = Ice.createTempClass()
    class AccountPremiumPrx(_M_Banks.AccountPrx):

        @staticmethod
        def checkedCast(proxy, facetOrContext=None, context=None):
            return _M_Banks.AccountPremiumPrx.ice_checkedCast(proxy, '::Banks::AccountPremium', facetOrContext, context)

        @staticmethod
        def uncheckedCast(proxy, facet=None):
            return _M_Banks.AccountPremiumPrx.ice_uncheckedCast(proxy, facet)

        @staticmethod
        def ice_staticId():
            return '::Banks::AccountPremium'
    _M_Banks._t_AccountPremiumPrx = IcePy.defineProxy('::Banks::AccountPremium', AccountPremiumPrx)

    _M_Banks.AccountPremiumPrx = AccountPremiumPrx
    del AccountPremiumPrx

    _M_Banks.AccountPremium = Ice.createTempClass()
    class AccountPremium(_M_Banks.Account):

        def ice_ids(self, current=None):
            return ('::Banks::Account', '::Banks::AccountPremium', '::Ice::Object')

        def ice_id(self, current=None):
            return '::Banks::AccountPremium'

        @staticmethod
        def ice_staticId():
            return '::Banks::AccountPremium'

        def __str__(self):
            return IcePy.stringify(self, _M_Banks._t_AccountPremiumDisp)

        __repr__ = __str__

    _M_Banks._t_AccountPremiumDisp = IcePy.defineClass('::Banks::AccountPremium', AccountPremium, (), None, (_M_Banks._t_AccountDisp,))
    AccountPremium._ice_type = _M_Banks._t_AccountPremiumDisp

    _M_Banks.AccountPremium = AccountPremium
    del AccountPremium

_M_Banks._t_AccountManager = IcePy.defineValue('::Banks::AccountManager', Ice.Value, -1, (), False, True, None, ())

if 'AccountManagerPrx' not in _M_Banks.__dict__:
    _M_Banks.AccountManagerPrx = Ice.createTempClass()
    class AccountManagerPrx(Ice.ObjectPrx):

        def createNewAccount(self, monthIncome, context=None):
            return _M_Banks.AccountManager._op_createNewAccount.invoke(self, ((monthIncome, ), context))

        def createNewAccountAsync(self, monthIncome, context=None):
            return _M_Banks.AccountManager._op_createNewAccount.invokeAsync(self, ((monthIncome, ), context))

        def begin_createNewAccount(self, monthIncome, _response=None, _ex=None, _sent=None, context=None):
            return _M_Banks.AccountManager._op_createNewAccount.begin(self, ((monthIncome, ), _response, _ex, _sent, context))

        def end_createNewAccount(self, _r):
            return _M_Banks.AccountManager._op_createNewAccount.end(self, _r)

        @staticmethod
        def checkedCast(proxy, facetOrContext=None, context=None):
            return _M_Banks.AccountManagerPrx.ice_checkedCast(proxy, '::Banks::AccountManager', facetOrContext, context)

        @staticmethod
        def uncheckedCast(proxy, facet=None):
            return _M_Banks.AccountManagerPrx.ice_uncheckedCast(proxy, facet)

        @staticmethod
        def ice_staticId():
            return '::Banks::AccountManager'
    _M_Banks._t_AccountManagerPrx = IcePy.defineProxy('::Banks::AccountManager', AccountManagerPrx)

    _M_Banks.AccountManagerPrx = AccountManagerPrx
    del AccountManagerPrx

    _M_Banks.AccountManager = Ice.createTempClass()
    class AccountManager(Ice.Object):

        def ice_ids(self, current=None):
            return ('::Banks::AccountManager', '::Ice::Object')

        def ice_id(self, current=None):
            return '::Banks::AccountManager'

        @staticmethod
        def ice_staticId():
            return '::Banks::AccountManager'

        def createNewAccount(self, monthIncome, current=None):
            raise NotImplementedError("servant method 'createNewAccount' not implemented")

        def __str__(self):
            return IcePy.stringify(self, _M_Banks._t_AccountManagerDisp)

        __repr__ = __str__

    _M_Banks._t_AccountManagerDisp = IcePy.defineClass('::Banks::AccountManager', AccountManager, (), None, ())
    AccountManager._ice_type = _M_Banks._t_AccountManagerDisp

    AccountManager._op_createNewAccount = IcePy.Operation('createNewAccount', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), IcePy._t_int, False, 0),), (), ((), _M_Banks._t_AccountPrx, False, 0), (_M_Banks._t_ErrorNewUser,))

    _M_Banks.AccountManager = AccountManager
    del AccountManager

# End of module Banks
