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
21 from CIM14
.IEC61968
.Common
.Organisation
import Organisation
23 class ServiceSupplier(Organisation
):
24 """Organisation that provides services to Customers.
27 def __init__(self
, kind
="retailer", issuerIdentificationNumber
='', CustomerAgreements
=None, ServiceDeliveryPoints
=None, *args
, **kw_args
):
28 """Initialises a new 'ServiceSupplier' instance.
30 @param kind: Kind of supplier. Values are: "retailer", "utility", "other"
31 @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.
32 @param CustomerAgreements: All customer agreements of this service supplier.
33 @param ServiceDeliveryPoints: All service delivery points this service supplier utilises to deliver a service.
35 #: Kind of supplier. Values are: "retailer", "utility", "other"
38 #: 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.
39 self
.issuerIdentificationNumber
= issuerIdentificationNumber
41 self
._CustomerAgreements
= []
42 self
.CustomerAgreements
= [] if CustomerAgreements
is None else CustomerAgreements
44 self
._ServiceDeliveryPoints
= []
45 self
.ServiceDeliveryPoints
= [] if ServiceDeliveryPoints
is None else ServiceDeliveryPoints
47 super(ServiceSupplier
, self
).__init
__(*args
, **kw_args
)
49 _attrs
= ["kind", "issuerIdentificationNumber"]
50 _attr_types
= {"kind": str, "issuerIdentificationNumber": str}
51 _defaults
= {"kind": "retailer", "issuerIdentificationNumber": ''}
52 _enums
= {"kind": "SupplierKind"}
53 _refs
= ["CustomerAgreements", "ServiceDeliveryPoints"]
54 _many_refs
= ["CustomerAgreements", "ServiceDeliveryPoints"]
56 def getCustomerAgreements(self
):
57 """All customer agreements of this service supplier.
59 return self
._CustomerAgreements
61 def setCustomerAgreements(self
, value
):
62 for x
in self
._CustomerAgreements
:
63 x
.ServiceSupplier
= None
65 y
._ServiceSupplier
= self
66 self
._CustomerAgreements
= value
68 CustomerAgreements
= property(getCustomerAgreements
, setCustomerAgreements
)
70 def addCustomerAgreements(self
, *CustomerAgreements
):
71 for obj
in CustomerAgreements
:
72 obj
.ServiceSupplier
= self
74 def removeCustomerAgreements(self
, *CustomerAgreements
):
75 for obj
in CustomerAgreements
:
76 obj
.ServiceSupplier
= None
78 def getServiceDeliveryPoints(self
):
79 """All service delivery points this service supplier utilises to deliver a service.
81 return self
._ServiceDeliveryPoints
83 def setServiceDeliveryPoints(self
, value
):
84 for x
in self
._ServiceDeliveryPoints
:
85 x
.ServiceSupplier
= None
87 y
._ServiceSupplier
= self
88 self
._ServiceDeliveryPoints
= value
90 ServiceDeliveryPoints
= property(getServiceDeliveryPoints
, setServiceDeliveryPoints
)
92 def addServiceDeliveryPoints(self
, *ServiceDeliveryPoints
):
93 for obj
in ServiceDeliveryPoints
:
94 obj
.ServiceSupplier
= self
96 def removeServiceDeliveryPoints(self
, *ServiceDeliveryPoints
):
97 for obj
in ServiceDeliveryPoints
:
98 obj
.ServiceSupplier
= None