Bumping version for release.
[PyCIM.git] / CIM14 / IEC61968 / Customers / ServiceCategory.py
blob6f2ad329c4b15d1af632a307288056287f65d2e6
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.IEC61970.Core.IdentifiedObject import IdentifiedObject
19 class ServiceCategory(IdentifiedObject):
20 """Category of service provided to the customer.
21 """
23 def __init__(self, kind="water", CustomerAgreements=None, PricingStructures=None, ServiceDeliveryPoints=None, *args, **kw_args):
24 """Initialises a new 'ServiceCategory' instance.
26 @param kind: Kind of service. Values are: "water", "time", "electricity", "heat", "rates", "gas", "internet", "refuse", "other", "tvLicence", "sewerage"
27 @param CustomerAgreements:
28 @param PricingStructures: All pricing structures applicable to this service category.
29 @param ServiceDeliveryPoints: All service delivery points that deliver this category of service.
30 """
31 #: Kind of service. Values are: "water", "time", "electricity", "heat", "rates", "gas", "internet", "refuse", "other", "tvLicence", "sewerage"
32 self.kind = kind
34 self._CustomerAgreements = []
35 self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements
37 self._PricingStructures = []
38 self.PricingStructures = [] if PricingStructures is None else PricingStructures
40 self._ServiceDeliveryPoints = []
41 self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints
43 super(ServiceCategory, self).__init__(*args, **kw_args)
45 _attrs = ["kind"]
46 _attr_types = {"kind": str}
47 _defaults = {"kind": "water"}
48 _enums = {"kind": "ServiceKind"}
49 _refs = ["CustomerAgreements", "PricingStructures", "ServiceDeliveryPoints"]
50 _many_refs = ["CustomerAgreements", "PricingStructures", "ServiceDeliveryPoints"]
52 def getCustomerAgreements(self):
54 return self._CustomerAgreements
56 def setCustomerAgreements(self, value):
57 for x in self._CustomerAgreements:
58 x.ServiceCategory = None
59 for y in value:
60 y._ServiceCategory = self
61 self._CustomerAgreements = value
63 CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements)
65 def addCustomerAgreements(self, *CustomerAgreements):
66 for obj in CustomerAgreements:
67 obj.ServiceCategory = self
69 def removeCustomerAgreements(self, *CustomerAgreements):
70 for obj in CustomerAgreements:
71 obj.ServiceCategory = None
73 def getPricingStructures(self):
74 """All pricing structures applicable to this service category.
75 """
76 return self._PricingStructures
78 def setPricingStructures(self, value):
79 for x in self._PricingStructures:
80 x.ServiceCategory = None
81 for y in value:
82 y._ServiceCategory = self
83 self._PricingStructures = value
85 PricingStructures = property(getPricingStructures, setPricingStructures)
87 def addPricingStructures(self, *PricingStructures):
88 for obj in PricingStructures:
89 obj.ServiceCategory = self
91 def removePricingStructures(self, *PricingStructures):
92 for obj in PricingStructures:
93 obj.ServiceCategory = None
95 def getServiceDeliveryPoints(self):
96 """All service delivery points that deliver this category of service.
97 """
98 return self._ServiceDeliveryPoints
100 def setServiceDeliveryPoints(self, value):
101 for x in self._ServiceDeliveryPoints:
102 x.ServiceCategory = None
103 for y in value:
104 y._ServiceCategory = self
105 self._ServiceDeliveryPoints = value
107 ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints)
109 def addServiceDeliveryPoints(self, *ServiceDeliveryPoints):
110 for obj in ServiceDeliveryPoints:
111 obj.ServiceCategory = self
113 def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints):
114 for obj in ServiceDeliveryPoints:
115 obj.ServiceCategory = None