Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61968 / PaymentMetering / ServiceSupplier.py
blob0ccd5c7bd7e3206010eca654bf71bed7beda3811
1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 # IN THE SOFTWARE.
21 from CIM15.IEC61968.Common.Organisation import Organisation
23 class ServiceSupplier(Organisation):
24 """Organisation that provides services to customers.Organisation that provides services to customers.
25 """
27 def __init__(self, issuerIdentificationNumber='', kind="other", BankAccounts=None, ServiceDeliveryPoints=None, CustomerAgreements=None, *args, **kw_args):
28 """Initialises a new 'ServiceSupplier' instance.
30 @param issuerIdentificationNumber: Unique transaction reference prefix number issued to an entity by the International Standards Organisation for the purpose of tagging onto electronic financial transactions, as defined in ISO/IEC 7812-1 and ISO/IEC 7812-2.
31 @param kind: Kind of supplier. Values are: "other", "retailer", "utility"
32 @param BankAccounts: All BackAccounts this ServiceSupplier owns.
33 @param ServiceDeliveryPoints: All service delivery points this service supplier utilises to deliver a service.
34 @param CustomerAgreements: All customer agreements of this service supplier.
35 """
36 #: Unique transaction reference prefix number issued to an entity by the International Standards Organisation for the purpose of tagging onto electronic financial transactions, as defined in ISO/IEC 7812-1 and ISO/IEC 7812-2.
37 self.issuerIdentificationNumber = issuerIdentificationNumber
39 #: Kind of supplier. Values are: "other", "retailer", "utility"
40 self.kind = kind
42 self._BankAccounts = []
43 self.BankAccounts = [] if BankAccounts is None else BankAccounts
45 self._ServiceDeliveryPoints = []
46 self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints
48 self._CustomerAgreements = []
49 self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements
51 super(ServiceSupplier, self).__init__(*args, **kw_args)
53 _attrs = ["issuerIdentificationNumber", "kind"]
54 _attr_types = {"issuerIdentificationNumber": str, "kind": str}
55 _defaults = {"issuerIdentificationNumber": '', "kind": "other"}
56 _enums = {"kind": "SupplierKind"}
57 _refs = ["BankAccounts", "ServiceDeliveryPoints", "CustomerAgreements"]
58 _many_refs = ["BankAccounts", "ServiceDeliveryPoints", "CustomerAgreements"]
60 def getBankAccounts(self):
61 """All BackAccounts this ServiceSupplier owns.
62 """
63 return self._BankAccounts
65 def setBankAccounts(self, value):
66 for x in self._BankAccounts:
67 x.ServiceSupplier = None
68 for y in value:
69 y._ServiceSupplier = self
70 self._BankAccounts = value
72 BankAccounts = property(getBankAccounts, setBankAccounts)
74 def addBankAccounts(self, *BankAccounts):
75 for obj in BankAccounts:
76 obj.ServiceSupplier = self
78 def removeBankAccounts(self, *BankAccounts):
79 for obj in BankAccounts:
80 obj.ServiceSupplier = None
82 def getServiceDeliveryPoints(self):
83 """All service delivery points this service supplier utilises to deliver a service.
84 """
85 return self._ServiceDeliveryPoints
87 def setServiceDeliveryPoints(self, value):
88 for x in self._ServiceDeliveryPoints:
89 x.ServiceSupplier = None
90 for y in value:
91 y._ServiceSupplier = self
92 self._ServiceDeliveryPoints = value
94 ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints)
96 def addServiceDeliveryPoints(self, *ServiceDeliveryPoints):
97 for obj in ServiceDeliveryPoints:
98 obj.ServiceSupplier = self
100 def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints):
101 for obj in ServiceDeliveryPoints:
102 obj.ServiceSupplier = None
104 def getCustomerAgreements(self):
105 """All customer agreements of this service supplier.
107 return self._CustomerAgreements
109 def setCustomerAgreements(self, value):
110 for x in self._CustomerAgreements:
111 x.ServiceSupplier = None
112 for y in value:
113 y._ServiceSupplier = self
114 self._CustomerAgreements = value
116 CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements)
118 def addCustomerAgreements(self, *CustomerAgreements):
119 for obj in CustomerAgreements:
120 obj.ServiceSupplier = self
122 def removeCustomerAgreements(self, *CustomerAgreements):
123 for obj in CustomerAgreements:
124 obj.ServiceSupplier = None