1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.IEC61968
.Common
.Organisation
import Organisation
19 class ServiceSupplier(Organisation
):
20 """Organisation that provides services to Customers.
23 def __init__(self
, kind
="retailer", issuerIdentificationNumber
='', CustomerAgreements
=None, ServiceDeliveryPoints
=None, *args
, **kw_args
):
24 """Initialises a new 'ServiceSupplier' instance.
26 @param kind: Kind of supplier. Values are: "retailer", "utility", "other"
27 @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.
28 @param CustomerAgreements: All customer agreements of this service supplier.
29 @param ServiceDeliveryPoints: All service delivery points this service supplier utilises to deliver a service.
31 #: Kind of supplier. Values are: "retailer", "utility", "other"
34 #: 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.
35 self
.issuerIdentificationNumber
= issuerIdentificationNumber
37 self
._CustomerAgreements
= []
38 self
.CustomerAgreements
= [] if CustomerAgreements
is None else CustomerAgreements
40 self
._ServiceDeliveryPoints
= []
41 self
.ServiceDeliveryPoints
= [] if ServiceDeliveryPoints
is None else ServiceDeliveryPoints
43 super(ServiceSupplier
, self
).__init
__(*args
, **kw_args
)
45 _attrs
= ["kind", "issuerIdentificationNumber"]
46 _attr_types
= {"kind": str, "issuerIdentificationNumber": str}
47 _defaults
= {"kind": "retailer", "issuerIdentificationNumber": ''}
48 _enums
= {"kind": "SupplierKind"}
49 _refs
= ["CustomerAgreements", "ServiceDeliveryPoints"]
50 _many_refs
= ["CustomerAgreements", "ServiceDeliveryPoints"]
52 def getCustomerAgreements(self
):
53 """All customer agreements of this service supplier.
55 return self
._CustomerAgreements
57 def setCustomerAgreements(self
, value
):
58 for x
in self
._CustomerAgreements
:
59 x
.ServiceSupplier
= None
61 y
._ServiceSupplier
= self
62 self
._CustomerAgreements
= value
64 CustomerAgreements
= property(getCustomerAgreements
, setCustomerAgreements
)
66 def addCustomerAgreements(self
, *CustomerAgreements
):
67 for obj
in CustomerAgreements
:
68 obj
.ServiceSupplier
= self
70 def removeCustomerAgreements(self
, *CustomerAgreements
):
71 for obj
in CustomerAgreements
:
72 obj
.ServiceSupplier
= None
74 def getServiceDeliveryPoints(self
):
75 """All service delivery points this service supplier utilises to deliver a service.
77 return self
._ServiceDeliveryPoints
79 def setServiceDeliveryPoints(self
, value
):
80 for x
in self
._ServiceDeliveryPoints
:
81 x
.ServiceSupplier
= None
83 y
._ServiceSupplier
= self
84 self
._ServiceDeliveryPoints
= value
86 ServiceDeliveryPoints
= property(getServiceDeliveryPoints
, setServiceDeliveryPoints
)
88 def addServiceDeliveryPoints(self
, *ServiceDeliveryPoints
):
89 for obj
in ServiceDeliveryPoints
:
90 obj
.ServiceSupplier
= self
92 def removeServiceDeliveryPoints(self
, *ServiceDeliveryPoints
):
93 for obj
in ServiceDeliveryPoints
:
94 obj
.ServiceSupplier
= None