# -*- 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 Bank
_M_Bank = Ice.openModule('Bank')
__name__ = 'Bank'

if 'AccountType' not in _M_Bank.__dict__:
    _M_Bank.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_Bank._t_AccountType = IcePy.defineEnum('::Bank::AccountType', AccountType, (), AccountType._enumerators)

    _M_Bank.AccountType = AccountType
    del AccountType

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

    _M_Bank._t_Currency = IcePy.defineEnum('::Bank::Currency', Currency, (), Currency._enumerators)

    _M_Bank.Currency = Currency
    del Currency

if 'RegistrationInfo' not in _M_Bank.__dict__:
    _M_Bank.RegistrationInfo = Ice.createTempClass()
    class RegistrationInfo(object):
        def __init__(self, password='', type=_M_Bank.AccountType.STANDARD):
            self.password = password
            self.type = type

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

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_Bank.RegistrationInfo):
                return NotImplemented
            else:
                if self.password is None or other.password is None:
                    if self.password != other.password:
                        return (-1 if self.password is None else 1)
                else:
                    if self.password < other.password:
                        return -1
                    elif self.password > other.password:
                        return 1
                if self.type is None or other.type is None:
                    if self.type != other.type:
                        return (-1 if self.type is None else 1)
                else:
                    if self.type < other.type:
                        return -1
                    elif self.type > other.type:
                        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_Bank._t_RegistrationInfo)

        __repr__ = __str__

    _M_Bank._t_RegistrationInfo = IcePy.defineStruct('::Bank::RegistrationInfo', RegistrationInfo, (), (
        ('password', (), IcePy._t_string),
        ('type', (), _M_Bank._t_AccountType)
    ))

    _M_Bank.RegistrationInfo = RegistrationInfo
    del RegistrationInfo

if 'LoanInfo' not in _M_Bank.__dict__:
    _M_Bank.LoanInfo = Ice.createTempClass()
    class LoanInfo(object):
        def __init__(self, isGranted=False, cost=0):
            self.isGranted = isGranted
            self.cost = cost

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

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_Bank.LoanInfo):
                return NotImplemented
            else:
                if self.isGranted is None or other.isGranted is None:
                    if self.isGranted != other.isGranted:
                        return (-1 if self.isGranted is None else 1)
                else:
                    if self.isGranted < other.isGranted:
                        return -1
                    elif self.isGranted > other.isGranted:
                        return 1
                if self.cost is None or other.cost is None:
                    if self.cost != other.cost:
                        return (-1 if self.cost is None else 1)
                else:
                    if self.cost < other.cost:
                        return -1
                    elif self.cost > other.cost:
                        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_Bank._t_LoanInfo)

        __repr__ = __str__

    _M_Bank._t_LoanInfo = IcePy.defineStruct('::Bank::LoanInfo', LoanInfo, (), (
        ('isGranted', (), IcePy._t_bool),
        ('cost', (), IcePy._t_int)
    ))

    _M_Bank.LoanInfo = LoanInfo
    del LoanInfo

if 'AccountInfo' not in _M_Bank.__dict__:
    _M_Bank.AccountInfo = Ice.createTempClass()
    class AccountInfo(object):
        def __init__(self, type=_M_Bank.AccountType.STANDARD, money=0):
            self.type = type
            self.money = money

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

        def __compare(self, other):
            if other is None:
                return 1
            elif not isinstance(other, _M_Bank.AccountInfo):
                return NotImplemented
            else:
                if self.type is None or other.type is None:
                    if self.type != other.type:
                        return (-1 if self.type is None else 1)
                else:
                    if self.type < other.type:
                        return -1
                    elif self.type > other.type:
                        return 1
                if self.money is None or other.money is None:
                    if self.money != other.money:
                        return (-1 if self.money is None else 1)
                else:
                    if self.money < other.money:
                        return -1
                    elif self.money > other.money:
                        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_Bank._t_AccountInfo)

        __repr__ = __str__

    _M_Bank._t_AccountInfo = IcePy.defineStruct('::Bank::AccountInfo', AccountInfo, (), (
        ('type', (), _M_Bank._t_AccountType),
        ('money', (), IcePy._t_int)
    ))

    _M_Bank.AccountInfo = AccountInfo
    del AccountInfo

if 'AccountException' not in _M_Bank.__dict__:
    _M_Bank.AccountException = Ice.createTempClass()
    class AccountException(Ice.UserException):
        def __init__(self, message=''):
            self.message = message

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

        __repr__ = __str__

        _ice_id = '::Bank::AccountException'

    _M_Bank._t_AccountException = IcePy.defineException('::Bank::AccountException', AccountException, (), False, None, (('message', (), IcePy._t_string, False, 0),))
    AccountException._ice_type = _M_Bank._t_AccountException

    _M_Bank.AccountException = AccountException
    del AccountException

if 'LoginException' not in _M_Bank.__dict__:
    _M_Bank.LoginException = Ice.createTempClass()
    class LoginException(Ice.UserException):
        def __init__(self, message=''):
            self.message = message

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

        __repr__ = __str__

        _ice_id = '::Bank::LoginException'

    _M_Bank._t_LoginException = IcePy.defineException('::Bank::LoginException', LoginException, (), False, None, (('message', (), IcePy._t_string, False, 0),))
    LoginException._ice_type = _M_Bank._t_LoginException

    _M_Bank.LoginException = LoginException
    del LoginException

if 'CurrencyException' not in _M_Bank.__dict__:
    _M_Bank.CurrencyException = Ice.createTempClass()
    class CurrencyException(Ice.UserException):
        def __init__(self, message=''):
            self.message = message

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

        __repr__ = __str__

        _ice_id = '::Bank::CurrencyException'

    _M_Bank._t_CurrencyException = IcePy.defineException('::Bank::CurrencyException', CurrencyException, (), False, None, (('message', (), IcePy._t_string, False, 0),))
    CurrencyException._ice_type = _M_Bank._t_CurrencyException

    _M_Bank.CurrencyException = CurrencyException
    del CurrencyException

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

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

        def createAccount(self, firstName, lastName, pin, income, context=None):
            return _M_Bank.AccountManager._op_createAccount.invoke(self, ((firstName, lastName, pin, income), context))

        def createAccountAsync(self, firstName, lastName, pin, income, context=None):
            return _M_Bank.AccountManager._op_createAccount.invokeAsync(self, ((firstName, lastName, pin, income), context))

        def begin_createAccount(self, firstName, lastName, pin, income, _response=None, _ex=None, _sent=None, context=None):
            return _M_Bank.AccountManager._op_createAccount.begin(self, ((firstName, lastName, pin, income), _response, _ex, _sent, context))

        def end_createAccount(self, _r):
            return _M_Bank.AccountManager._op_createAccount.end(self, _r)

        def getLoan(self, pin, password, howMuch, currency, context=None):
            return _M_Bank.AccountManager._op_getLoan.invoke(self, ((pin, password, howMuch, currency), context))

        def getLoanAsync(self, pin, password, howMuch, currency, context=None):
            return _M_Bank.AccountManager._op_getLoan.invokeAsync(self, ((pin, password, howMuch, currency), context))

        def begin_getLoan(self, pin, password, howMuch, currency, _response=None, _ex=None, _sent=None, context=None):
            return _M_Bank.AccountManager._op_getLoan.begin(self, ((pin, password, howMuch, currency), _response, _ex, _sent, context))

        def end_getLoan(self, _r):
            return _M_Bank.AccountManager._op_getLoan.end(self, _r)

        def inspectAccount(self, pin, password, context=None):
            return _M_Bank.AccountManager._op_inspectAccount.invoke(self, ((pin, password), context))

        def inspectAccountAsync(self, pin, password, context=None):
            return _M_Bank.AccountManager._op_inspectAccount.invokeAsync(self, ((pin, password), context))

        def begin_inspectAccount(self, pin, password, _response=None, _ex=None, _sent=None, context=None):
            return _M_Bank.AccountManager._op_inspectAccount.begin(self, ((pin, password), _response, _ex, _sent, context))

        def end_inspectAccount(self, _r):
            return _M_Bank.AccountManager._op_inspectAccount.end(self, _r)

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

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

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

    _M_Bank.AccountManagerPrx = AccountManagerPrx
    del AccountManagerPrx

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

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

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

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

        def createAccount(self, firstName, lastName, pin, income, current=None):
            raise NotImplementedError("servant method 'createAccount' not implemented")

        def getLoan(self, pin, password, howMuch, currency, current=None):
            raise NotImplementedError("servant method 'getLoan' not implemented")

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

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

        __repr__ = __str__

    _M_Bank._t_AccountManagerDisp = IcePy.defineClass('::Bank::AccountManager', AccountManager, (), None, ())
    AccountManager._ice_type = _M_Bank._t_AccountManagerDisp

    AccountManager._op_createAccount = IcePy.Operation('createAccount', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), IcePy._t_string, False, 0), ((), IcePy._t_string, False, 0), ((), IcePy._t_string, False, 0), ((), IcePy._t_int, False, 0)), (), ((), _M_Bank._t_RegistrationInfo, False, 0), (_M_Bank._t_AccountException,))
    AccountManager._op_getLoan = IcePy.Operation('getLoan', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), IcePy._t_string, False, 0), ((), IcePy._t_string, False, 0), ((), IcePy._t_int, False, 0), ((), _M_Bank._t_Currency, False, 0)), (), ((), _M_Bank._t_LoanInfo, False, 0), (_M_Bank._t_LoginException, _M_Bank._t_CurrencyException))
    AccountManager._op_inspectAccount = IcePy.Operation('inspectAccount', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), IcePy._t_string, False, 0), ((), IcePy._t_string, False, 0)), (), ((), _M_Bank._t_AccountInfo, False, 0), (_M_Bank._t_LoginException,))

    _M_Bank.AccountManager = AccountManager
    del AccountManager

# End of module Bank
